Simple issue please help
#1

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

PHP код:
    //setplayerteamfromclass
case .. 9:
        {
            
gTeam[playerid] = GROVES;
               
cS_Show(playerid);
               
cS_Update(playerid0x4682B4FF"~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.010000);
        }
// 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(playeridred"You are not a member of this faction");
        }
    } 
Reply
#2

Do not trust me on this one but do this
PHP код:
if(gTeam[playerid] == POLICE)
    {
        if(
pInfo[playerid][Faction] != 1)
        {
            
SendClientMessage(playeridred"You are not a member of this faction");
            return 
1;
        }
    } 
I jsut returned 1 under SendClientMessage
Reply
#3

Quote:
Originally Posted by Micko123
Посмотреть сообщение
Do not trust me on this one but do this
PHP код:
if(gTeam[playerid] == POLICE)
    {
        if(
pInfo[playerid][Faction] != 1)
        {
            
SendClientMessage(playeridred"You are not a member of this faction");
            return 
1;
        }
    } 
I jsut returned 1 under SendClientMessage
thats wont work any other suggestions?
Reply
#4

Place it OnPlayerRequestSpawn (not OnPlayerRequestClass)

PHP код:
if(gTeam[playerid] == POLICE && pInfo[playerid][pFaction] != 1)
{
    
SendClientMessage(playeridred"You are not a member of this faction");
    return 
0;

Returning 0 will prevent players from spawning.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)