classid
#1

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.
Reply
#2

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
Reply
#3

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

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.
Reply
#5

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.
Reply
#6

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.
Reply
#7

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)
Reply
#8

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)
Reply
#9

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
}
Reply
#10

thanks worked
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)