SA-MP Forums Archive
classid - 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: classid (/showthread.php?tid=166316)



classid - billiout - 08.08.2010

how to use the classid on player spawn? i mean i hve some classes on a certain team but i want 8 classes from this team spawn at a cartain spawn point. pls help.


Re: classid - iggy1 - 08.08.2010

In OnPlayerSpawn
pawn Код:
if(GetPlayerTeam(playerid)== YOUR_TEAM_IDS) //swap for your team id
{
    SetPlayerPos(playerid,x,y,z); //spawnpoint co-ords
}
]if(GetPlayerTeam(playerid)== YOUR_TEAM_IDS)//swap for another team id
{
    SetPlayerPos(playerid,x,y,z); //more spawnpoint co-ords
}
If you are not using teams just swap if(GetPlayerTeam(playerid)==blahblah -for- if(GetPlayerSkin(playerid)==blahblah


Re: classid - billiout - 08.08.2010

thanks for help but the first gave me an idea. how to use the if(GetPlayerSkin(playerid) == 25) example like if(!GetPlayerSkin(playerid) == 25)?


Re: classid - Carlton - 08.08.2010

Quote:
Originally Posted by billiout
Посмотреть сообщение
thanks for help but the first gave me an idea. how to use the if(GetPlayerSkin(playerid) == 25) example like if(!GetPlayerSkin(playerid) == 25)?
! is used if the value is 0, a example is:

pawn Код:
if(!GetPlayerSkin(playerid)) {

}
That meant if the GetPlayerSkin returned 0. So the first one would be correct.


Re: classid - iggy1 - 08.08.2010

pawn Код:
if(GetPlayerSkin(playerid) == 25)//check for 1 skin id
{
    SetPlayerPos(playerid,x,y,z);//would work
}
if(GetPlayerSkin(playerid) == 25 || 26 || 27)//check for several skin ids
{
    SetPlayerPos(playerid,x,y,z);//would work too but for 3 skins
}
Note these ids are an example they may not be valid skin ids.

Edit: never knew that carlton nice1.


Re: classid - billiout - 08.08.2010

because i have alot skins and i dont want to count them all and put them getplayerskin { blah } i want to have if player isnt some skins for example 5,2. i hope you understand.


Re: classid - iggy1 - 08.08.2010

pawn Код:
if(!GetPlayerSkin(playerid) == 25)//check if a player isnt id 25
{
    SetPlayerPos(playerid,x,y,z);//would work
}
if(!GetPlayerSkin(playerid) == 25 || 26 || 27)//check if player isn't 25,26,27
{
    SetPlayerPos(playerid,x,y,z);//would work too but for 3 skins
}
Logical operator '!' (exclaimation mark)


Re: classid - billiout - 08.08.2010

Quote:
Originally Posted by iggy1
Посмотреть сообщение
pawn Код:
if(!GetPlayerSkin(playerid) == 25)//check if a player isnt id 25
{
    SetPlayerPos(playerid,x,y,z);//would work
}
if(!GetPlayerSkin(playerid) == 25 || 26 || 27)//check if player isn't 25,26,27
{
    SetPlayerPos(playerid,x,y,z);//would work too but for 3 skins
}
Logical operator '!' (exclaimation mark)
Код:
warning 213: tag mismatch
for the if(!GetPlayerSkin(playerid) == 25 || 26 || 27)


Re: classid - iggy1 - 08.08.2010

Sorry try

pawn Код:
if(GetPlayerSkin(playerid) != 25)//check if a player isnt id 25
{
    SetPlayerPos(playerid,x,y,z);//would work
}
if(GetPlayerSkin(playerid) != 25 || 26 || 27)//check if player isn't 25,26,27
{
    SetPlayerPos(playerid,x,y,z);//would work too but for 3 skins
}



Re: classid - billiout - 08.08.2010

thanks worked