lspd track
#1

Can anyone point me in the right direction, I,ve edited the track command in West coast RP to be used by lspd, yet when i try to use the command it says im not a member of lspd.........any help would be appreciated:


//-------------------_-----LSPD tracking system------------------------------//
if(strcmp(cmd, "/track", true) == 0)
{
if(PlayerInfo[playerid][pMember] != 1 ||PlayerInfo[playerid][pLeader] != 1)
{
SendClientMessage(playerid, COLOR_GREY, " You are not a member of the lspd !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /track [playerid/PartOfName]");
return 1;
}
lspdtrack = ReturnUser(tmp);
if(IsPlayerConnected(lspdtrack))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(lspdtrack, giveplayer, sizeof(giveplayer));
new Float:X,Float:Y,Float:Z;
GetPlayerPos(lspdtrack, X,Y,Z);
SetPlayerMarkerForPlayer(playerid,lspdtrack, 0xFF0000FF );
SendClientMessage(playerid, COLOR_LIGHTBLUE, " Suspect is now visible, get him !");
}
}
}
if (strcmp(cmdtext, "/canceltrack", true)==0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMember] == 1 ||PlayerInfo[playerid][pLeader] != 1)
{
SetPlayerMarkerForPlayer(playerid, lspdtrack, 0xFFFFFF00 );
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid, COLOR_LIGHTBLUE, " Suspect is now unvisible!");
return 1;
Reply
#2

make sure about this if statement:

This means that if " you " ( pMember ) is NOT! 1 OR You ( Leader ) is NOT! 1 Then do this...
Код:
   if(PlayerInfo[playerid][pMember] != 1 ||PlayerInfo[playerid][pLeader] != 1)
i think your problem is with the If statement

try to replace the " || " to " && " so it will say that if pmember is not 1 AND pleader is not 1 then...


|| means OR
&& means AND

Logic Gates will come useful in these things
Reply
#3

many thanks for your reply, but do you mean replace = with &&? i see no characters like you indicated......
Reply
#4

no... replace " || " with " && " its just in the middle of the if statement....

This is how i'm saying....
if(PlayerInfo[playerid][pMember] != 1 && PlayerInfo[playerid][pLeader] != 1)

and this is yours:
if(PlayerInfo[playerid][pMember] != 1 ||PlayerInfo[playerid][pLeader] != 1)
Reply
#5

ah i must be blind, i see it now many thanks again
Reply
#6

works like a charm, If I could I would buy you a few beers. Many thanks man. I owe you one
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)