PDA

View Full Version : Simple issue please help


1fret
03/11/2016, 08:29 AM
Ok i made a very simple and quick faction system but i have a problem i want to restrict others from using the skin... Example its a police skin but i want when someone trying to spawn with that skin it will tell them they cant use it.... Im using case but if statement and case dont seems to work with each other is there any other way i can do this....

//setplayerteamfromclass
case 4 .. 9:
{
gTeam[playerid] = GROVES;
cS_Show(playerid);
cS_Update(playerid, 0x4682B4FF, "~g~Grove Family", "~g~]~w~ The Grove members are to protect there turfs. ~s~~n~~g~]~w~ Kill there enemies.");
SetPlayerPos(playerid,2500.6060,-1672.1453,13.3512);
SetPlayerCameraPos(playerid,2507.0615,-1674.3574,13.3732);
SetPlayerCameraLookAt(playerid,2500.6060,-1672.1453,13.3512);
SetPlayerFacingAngle(playerid,252.4717);
ApplyAnimation(playerid, "PED", "FUCKU", 4.0, 1, 0, 0, 0, 0);

}
// now this is what i use to check if player is in the faction if not it should send them this message.. but is sends the message and stills spawns them
if(gTeam[playerid] == POLICE)
{
if(pInfo[playerid][Faction] != 1)
{
SendClientMessage(playerid, red, "You are not a member of this faction");
}
}

Micko123
03/11/2016, 08:33 AM
Do not trust me on this one but do this

if(gTeam[playerid] == POLICE)
{
if(pInfo[playerid][Faction] != 1)
{
SendClientMessage(playerid, red, "You are not a member of this faction");
return 1;
}
}


I jsut returned 1 under SendClientMessage

1fret
03/11/2016, 08:44 AM
Do not trust me on this one but do this

if(gTeam[playerid] == POLICE)
{
if(pInfo[playerid][Faction] != 1)
{
SendClientMessage(playerid, red, "You are not a member of this faction");
return 1;
}
}


I jsut returned 1 under SendClientMessage

thats wont work any other suggestions?

JaKe Elite
03/11/2016, 09:06 AM
Place it OnPlayerRequestSpawn (not OnPlayerRequestClass)


if(gTeam[playerid] == POLICE && pInfo[playerid][pFaction] != 1)
{
SendClientMessage(playerid, red, "You are not a member of this faction");
return 0;
}


Returning 0 will prevent players from spawning.