SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 20/12/2012, 02:31 PM   #1
diego_p11
Big Clucker
 
Join Date: Aug 2011
Posts: 70
Reputation: 5
Default how to make to someone choose an skin

Hi, what I need to know is how to make when a player conects apears some skins, and below it is something like

<<< ok >>>

I dunno how is called =P but hope you understand me =)
So please, can someone help me =)
diego_p11 is offline   Reply With Quote
Old 20/12/2012, 02:35 PM   #2
LarzI
High-roller
 
LarzI's Avatar
 
Join Date: Apr 2007
Location: Norway
Posts: 2,628
Reputation: 136
Default Re: how to make to someone choose an skin

OnPlayerRequestClass is a callback which calls after OnPlayerConnect, before OnPlayerRequestSpawn. Use that. If you search the wiki you will find lots of tutorials and basics on this subject.
__________________


NEW: [FS] Simple Cellphones

if( strfind( title, "REP", true ) != -1 )
{________________________________________
Sigh();__________________________
}________________________________________


LarzI is offline   Reply With Quote
Old 20/12/2012, 02:51 PM   #3
diego_p11
Big Clucker
 
Join Date: Aug 2011
Posts: 70
Reputation: 5
Default Re: how to make to someone choose an skin

thanks =)
diego_p11 is offline   Reply With Quote
Old 20/12/2012, 05:30 PM   #4
diego_p11
Big Clucker
 
Join Date: Aug 2011
Posts: 70
Reputation: 5
Default Re: how to make to someone choose an skin

continue without an ideao on how to doit :`(
Please someone help me, or at least give me a link on where i can learn it =D
diego_p11 is offline   Reply With Quote
Old 20/12/2012, 05:37 PM   #5
Nick.D
Little Clucker
 
Join Date: Jun 2012
Posts: 31
Reputation: 1
Default Re: how to make to someone choose an skin

You need to use OnPlayerRequestClass and AddPlayerClass to create classes with different skins. Then when a player connects, they will be able to use the arrows to choose a different class (different skin).
Nick.D is offline   Reply With Quote
Old 20/12/2012, 05:54 PM   #6
diego_p11
Big Clucker
 
Join Date: Aug 2011
Posts: 70
Reputation: 5
Default Re: how to make to someone choose an skin

what i have done is:
pawn Code:
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 2323.6460, 1283.2372, 97.8800);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    (playerid, 0);
    (playerid, 1);
    (playerid, 2);
    (playerid, 3);
    (playerid, 4);
    (playerid, 5);
    (playerid, 6);
    (playerid, 7);
    (playerid, 8);
    (playerid, 9);
    (playerid, 10);
    (playerid, 11);
    (playerid, 12);
    (playerid, 13);
    (playerid, 14);
    (playerid, 15);
   
    return 1;
}
pawn Code:
public OnGameModeInit()
{
    AddPlayerClass(0,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(1,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(2,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(3,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(4,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(5,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(6,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(7,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(8,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(9,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(10,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(11,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(12,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(13,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(14,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(15,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
Is it right??
diego_p11 is offline   Reply With Quote
Old 20/12/2012, 06:01 PM   #7
Nick.D
Little Clucker
 
Join Date: Jun 2012
Posts: 31
Reputation: 1
Default Re: how to make to someone choose an skin

pawn Code:
public OnGameModeInit()
{
    AddPlayerClass(0,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(1,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(2,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(3,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(4,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(5,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(6,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(7,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(8,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(9,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(10,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(11,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(12,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(13,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(14,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(15,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
This is right, but now under OnPlayerRequestClass...
pawn Code:
public OnPlayerRequestClass(playerid, classid)
{
    switch(classid)
    {
        case 0:
        {
             SetPlayerSkin(playerid, 1);
        }

And so on for each class... unless you just want to use if(classid == 1) and then SetPlayerSkin for each class.
Nick.D is offline   Reply With Quote
Old 20/12/2012, 06:30 PM   #8
diego_p11
Big Clucker
 
Join Date: Aug 2011
Posts: 70
Reputation: 5
Default Re: how to make to someone choose an skin

I did that and i got this error:
Code:
C:\Users\Parrilla\Desktop\SAR\gamemodes\SAR.pwn(142) : error 002: only a single statement (or expression) can follow each "case"

EDIT: Fixed

Last edited by diego_p11; 20/12/2012 at 06:33 PM. Reason: Fixed
diego_p11 is offline   Reply With Quote
Old 20/12/2012, 06:42 PM   #9
Yiin
Banned
 
Join Date: Aug 2012
Location: Lithuania
Posts: 145
Reputation: 20
Default Re: how to make to someone choose an skin

pawn Code:
public OnPlayerRequestClass(playerid, classid)
{
    switch(classid)
    {
        case 0:
        {
             SetPlayerSkin(playerid, 1);
        }
        case 1:
        {
            SetPlayerSkin(playerid, 2);
            print("msg");
        }
    }
    return 1;
}
Yiin is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
skin choose cmd bartje01 Help Archive 3 03/02/2010 10:28 PM
A Skin Choose Problem GforceNL Help Archive 4 20/10/2009 06:07 PM
SetPlayerWeather only for skin choose? help please TopeK Help Archive 6 24/09/2009 05:50 PM
GetPlayerIp and set skin choose Frankox Help Archive 5 13/07/2009 04:45 PM
Whatever skin I choose I keep spawning as CJ Daan de Vries Server Support 2 03/06/2009 08:32 PM


All times are GMT. The time now is 03:15 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.