Question about multipul numbers in "if"
#1

I am trying to make a script that tells the player the spawn point they have chosen (based on skin ID) when they spawn. so if there skin is "282" they get the message "Police Spawn" when they spawn. At the moment i can only do it for one skin, how do i do it for a number of skins e.g 281, 183 and 287? My current code is pasted at the bottom but that compiles but dosnt work

pawn Код:
public OnPlayerSpawn(playerid)
{
    if(GetPlayerSkin(playerid) == 285/282/281/283/287/286) return SendClientMessage(playerid, COLOR_RED, "Police Spawn");
    else if(GetPlayerSkin(playerid) == 274/275/276) return SendClientMessage(playerid, COLOR_RED, "Medic Spawn");
    else if(GetPlayerSkin(playerid) == 105/106/107/269/270/271) return SendClientMessage(playerid, COLOR_RED, "Grove Spawn");
    else if(GetPlayerSkin(playerid) == 0) return SendClientMessage(playerid, COLOR_RED, "CJ Spawn");
    else if(GetPlayerSkin(playerid) == 274/275/276) return SendClientMessage(playerid, COLOR_RED, "Police Class!");
    return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)