SA-MP Forums Archive
Simple issue please help - 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)
+--- Thread: Simple issue please help (/showthread.php?tid=620784)



Simple issue please help - 1fret - 03.11.2016

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");
        }
    } 



Re: Simple issue please help - Micko123 - 03.11.2016

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


Re: Simple issue please help - 1fret - 03.11.2016

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?


Re: Simple issue please help - JaKe Elite - 03.11.2016

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.