Whats wrong?
#1

my code:
Код:
	if(strcmp(cmd, "/deployspikes", true) == 0)
	{
        if(IsACop(playerid) || IsAnAgent(playerid) || IsASoldier(playerid))
	    {
	        return SendClientMessage(playerid,COLOR_GREY,"   You are not a member of the LSPD / SASD / DoC !");
	    }
	    if(PlayerInfo[playerid][pMember] == 1)
	    {
		    if(PlayerInfo[playerid][pRank] < 4)
		    {
		        return SendClientMessage(playerid,COLOR_GREY,"   Your rank is too low to be deploying spike strips !");
		    }
		}
		else
		{
		    if(PlayerInfo[playerid][pRank] < 5)
		    {
		        return SendClientMessage(playerid,COLOR_GREY,"   Your rank is too low to be removing spike strips !");
		    }
		}
	    if(IsPlayerInAnyVehicle(playerid))
	    {
	        return SendClientMessage(playerid,COLOR_GREY,"   You cannot place a spike strip while inside a vehicle !");
	    }
	    new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
	    GetPlayerPos(playerid,plocx,plocy,plocz);
	    GetPlayerFacingAngle(playerid,ploca);
	    new location[MAX_ZONE_NAME];
		GetPlayer2DZone(playerid, location, MAX_ZONE_NAME);
		new Float:x, Float:y, Float:z, Float:angle;
	    GetPlayerFacingAngle(playerid, angle);
	    GetPlayerPos(playerid, x, y, z);
		CreateStrip(x, y, z, angle);
	    format(string, sizeof(string), "building: %s %s has placed a spike strip at %s", GetPlayerRank(playerid),PlayerName(playerid), location);
		SendRadioMessage(1, TEAM_BLUE_COLOR, string);
		SendRadioMessage(2, TEAM_BLUE_COLOR, string);
		SendRadioMessage(3, TEAM_BLUE_COLOR, string);
		SendRadioMessage(5, TEAM_BLUE_COLOR, string);
		ApplyAnimation(playerid, "BOMBER","BOM_Plant_Loop",4.0,0,0,0,0,0); // Plant bomb
        /*GetPlayerFacingAngle(playerid,ploca);
        CreateStrip(plocx,plocy,plocz,ploca);*/
	    return 1;
	}
But when im lspd and rank 5+...

still it shows im not in lspd. why is that?
Reply
#2

If a player is none of the above, then they cannot use the command so simply:
PHP код:
if(!IsACop(playerid) && !IsAnAgent(playerid) && !IsASoldier(playerid))
{
    return 
SendClientMessage(playerid,COLOR_GREY,"   You are not a member of the LSPD / SASD / DoC !");

Reply
#3

if(!IsACop(playerid) && !IsAnAgent(playerid) && !IsASoldier(playerid))
Reply
#4

Thank you very much! It worked.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)