SA-MP Forums Archive
SetPlayerClassId() posible? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: SetPlayerClassId() posible? (/showthread.php?tid=118780)



SetPlayerClassId() posible? - [SOB]Chris - 05.01.2010

i need some function like this SetPlayerClassId(playerid,classid); this for what? your ask, well i want make a classelection divide by gender and my code is this.

pawn Код:
public OnPlayerRequestClass(playerid,classid)
{
    switch (PlayerInfo[playerid][gender])
    {
        case -1: return 0;
        case 0: SetupPlayerForClassSelectionM(playerid);
        case 1: SetupPlayerForClassSelectionW(playerid);
    }
    if (PlayerInfo[playerid][gender] == 1 && classid < 194)
    {
    SetPlayerClassId(playerid,194); //and the class 194 is a women
    }
    return 1;
}
mm the classid and skinid is not the same thing! if you say put this in your code SetPlayerSkin() -.- no, because is a diferent thing.
some can help me or say me "are you crazy this is imposible" u.u


Re: SetPlayerClassId() posible? - Grim_ - 05.01.2010

Use the callback itself.
Example
pawn Код:
OnPlayerRequestClass(playerid, 100);



Re: SetPlayerClassId() posible? - [SOB]Chris - 05.01.2010

Quote:
Originally Posted by _Xerxes_
Use the callback itself.
Example
pawn Код:
OnPlayerRequestClass(playerid, 100);
yep i try this lately, and sorry but no say it xd, but dont work i try and dont work for all...
if im put this
pawn Код:
OnPlayerRequestClass(playerid, 194);
call the callback but with the classid number 0, every i call this OnPlayerRequestClass show the classid 0 for default =S



Re: SetPlayerClassId() posible? - Grim_ - 05.01.2010

Quote:
Originally Posted by [SOB
Chris ]
Quote:
Originally Posted by _Xerxes_
Use the callback itself.
Example
pawn Код:
OnPlayerRequestClass(playerid, 100);
yep i try this lately, and sorry but no say it xd, but dont work i try and dont work for all...
if im put this
pawn Код:
OnPlayerRequestClass(playerid, 194);
call the callback but with the classid number 0, every i call this OnPlayerRequestClass show the classid 0 for default =S
When you say it doesn't work; Does it not set your to the correct class id or does it not have any effect?


Re: SetPlayerClassId() posible? - [SOB]Chris - 05.01.2010

Quote:
Originally Posted by _Xerxes_
Quote:
Originally Posted by [SOB
Chris ]
Quote:
Originally Posted by _Xerxes_
Use the callback itself.
Example
pawn Код:
OnPlayerRequestClass(playerid, 100);
yep i try this lately, and sorry but no say it xd, but dont work i try and dont work for all...
if im put this
pawn Код:
OnPlayerRequestClass(playerid, 194);
call the callback but with the classid number 0, every i call this OnPlayerRequestClass show the classid 0 for default =S
When you say it doesn't work; Does it not set your to the correct class id or does it not have any effect?
Dont set the correct class id, the classid i want set. but yes have effect.


Re: SetPlayerClassId() posible? - Grim_ - 05.01.2010

Quote:
Originally Posted by [SOB
Chris ]
Quote:
Originally Posted by _Xerxes_
Quote:
Originally Posted by [SOB
Chris ]
Quote:
Originally Posted by _Xerxes_
Use the callback itself.
Example
pawn Код:
OnPlayerRequestClass(playerid, 100);
yep i try this lately, and sorry but no say it xd, but dont work i try and dont work for all...
if im put this
pawn Код:
OnPlayerRequestClass(playerid, 194);
call the callback but with the classid number 0, every i call this OnPlayerRequestClass show the classid 0 for default =S
When you say it doesn't work; Does it not set your to the correct class id or does it not have any effect?
Dont set the correct class id, the classid i want set. but yes have effect.
As you said, classid and skinid are different, are you sure it's not setting the correct classid, but it's a different skinid that you want?


Re: SetPlayerClassId() posible? - [SOB]Chris - 05.01.2010

Quote:
Originally Posted by _Xerxes_
As you said, classid and skinid are different, are you sure it's not setting the correct classid, but it's a different skinid that you want?
yes, but i tried what you say putting this code
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    switch (PlayerInfo[playerid][genero])
    {
        case -1: return 0;
        case 0: SetupPlayerForClassSelectionM(playerid);
        case 1: SetupPlayerForClassSelectionW(playerid);
    }
    if (PlayerInfo[playerid][genero] == 1 && classid < 194)
    {
    OnPlayerRequestClass(playerid, 194);
        SendClientMessage(playerid,WHITE,"This is not the 194 classid"); //show this message if the classid dont change to 194 avery time i change the skin with the arrows
    }
    return 1;
}



Re: SetPlayerClassId() posible? - [SOB]Chris - 08.01.2010

someone? ='(,
or any idea to limit the playerclass


Re: SetPlayerClassId() posible? - [SOB]Chris - 08.01.2010

Zomgf ^^ thanks, but i can use only the ysi skin system or i need change all my gm?