SA-MP Forums Archive
Small problem.. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Small problem.. (/showthread.php?tid=275344)



Small problem.. - rashier - 09.08.2011

Hello, I have this command but do not know how to go only for police.
PHP код:
else if(strcmp(x_nr,"setplate",true) == 0)
            {
                if(
IsPlayerInVehicle(playeridvehid) || PlayerInfo[vehid][pPcarkey] != -&& PlayerInfo[vehid][pPcarkey2] != -&& PlayerInfo[vehid][pPcarkey3] != -1)
                {
                    if(
cmdtext[idx++] != 32 || cmdtext[idx] == EOS)
                    {
                        
SendClientMessage(playerid,0xFFFFFFAA,"USAGE: /v setplate [newplate]");
                        return 
1;
                    }
                    new 
Float:XX,Float:YY,Float:ZZ,Float:AA;
                    new 
Float:CarHPFloat:OldCarHP;
                    new 
panels,doors,lights,tires;
                    
GetVehicleHealth(vehidCarHP);
                    
GetVehicleDamageStatus(vehid,panels,doors,lights,tires);
                    
OldCarHP CarHP;
                    
format(CarInfo[vehid][cLicense], 32 ,"%s",cmdtext[idx]);
                    
SetVehicleNumberPlate(vehid,CarInfo[vehid][cLicense]);
                    
GetVehiclePos(vehid,XX,YY,ZZ);
                    
GetVehicleZAngle(vehidAA);
                    
SetVehicleToRespawn(vehid);
                    
SetVehiclePos(vehid,XX,YY,ZZ);
                    
SetVehicleZAngle(vehidAA);
                    
PutPlayerInVehicle(playerid,vehid,0);
                    
SetVehicleHealth(vehidOldCarHP);
                    
UpdateVehicleDamageStatus(vehid,panels,doors,lights,tires);
                    
format(stringsizeof(string), "{FFFF00}You have set your vehicle's plate to:{FFFFFF} %s"CarInfo[vehid][cLicense]);
                    
SendClientMessage(playerid0xFFFFFFFFstring);
                    
OnPropUpdate(); SavePlayerData(playerid);
                }
                else
                {
                    
SendClientMessage(playerid0xFFFFFFAA"You're not in your car to change the license plate..");
                    return 
1;
                }
            } 
I want just a cop to be able to register.
This is a part of Filterscript,and ai have this in gamemode
PHP код:
if(PlayerInfo[playerid][pMember] == || PlayerInfo[playerid][pLeader] == 1)
           { 
And: enum pinfo
PHP код:
pLeader,
    
pMember



Re: Small problem.. - rashier - 09.08.2011

Someone to helpme?,please...


Re: Small problem.. - admantis - 09.08.2011

You have to add the following check:
pawn Код:
if ( !PlayerInfo[playerid][pMember] != 1 ) { return SendClientMessage( playerid, 0xFFFFFFFF, "you must be cop to do this"), 1; }