"/makecop" is bugged!
#1

This is my /makecop

pawn Код:
if(strcmp(cmdtext, "/makecop", true) == 0)
            {
            new tmp[128];
            new idx;
            new giveplayerid;
            if(IsPlayerConnected(playerid))
            {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
            SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /makecop [playerid]");
            }
            if (IsPlayerConnected(giveplayerid))
            {
          if(giveplayerid != INVALID_PLAYER_ID)
          {
            CopMake(giveplayerid);
            SendClientMessage(giveplayerid, COLOR_BLUE, "You have been made a police officer. Changes will appear on next death.");
            }
            }
            }
            return 1;
            }
It makes playerid 0 a cop, no matter what i write
How do I fix this?
Reply
#2

Код:
	if(strcmp(cmdtext, "/makecop", true) == 0)
			{
			new tmp[128];
			new player1 = strval(tmp);
 			if(IsPlayerConnected(player1))
			{
			if(!strlen(tmp))
			{
			SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /makecop [playerid]");
			}
			if (!IsPlayerConnected(player1)) return SendClientMessage(playerid, color, "player is not connected.");
			{
	  		CopMake(player1);
	  		SendClientMessage(player1, COLOR_BLUE, "You have been made a police officer. Changes will appear on next death.");
			}
  			}
			}
			return 1;
			}
this should work
Reply
#3

ahem...

if(strcmp(cmdtext, "/makecop", true) == 0)
{
new tmp[128];
new player1 = strval(tmp);
if(IsPlayerConnected(player1))
{
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /makecop [playerid]");
}
if (!IsPlayerConnected(player1)) return SendClientMessage(playerid, color, "player is not connected.");
{
CopMake(player1);
SendClientMessage(player1, COLOR_BLUE, "You have been made a police officer. Changes will appear on next death.");
}
}
} // where did that one come from?
return 1;
}


Thanks, but you added one closing bracket to much.
Reply
#4

Quote:
Originally Posted by Chriham3
ahem...

if(strcmp(cmdtext, "/makecop", true) == 0)
{
new tmp[128];
new player1 = strval(tmp);
if(IsPlayerConnected(player1))
{
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /makecop [playerid]");
}
if (!IsPlayerConnected(player1)) return SendClientMessage(playerid, color, "player is not connected.");
{
CopMake(player1);
SendClientMessage(player1, COLOR_BLUE, "You have been made a police officer. Changes will appear on next death.");
}
}
} // where did that one come from?
return 1;
}


Thanks, but you added one closing bracket to much.
added by mistaken just remove it
Reply
#5

Quote:
Originally Posted by _Saif_
Quote:
Originally Posted by Chriham3
ahem...

if(strcmp(cmdtext, "/makecop", true) == 0)
{
new tmp[128];
new player1 = strval(tmp);
if(IsPlayerConnected(player1))
{
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /makecop [playerid]");
}
if (!IsPlayerConnected(player1)) return SendClientMessage(playerid, color, "player is not connected.");
{
CopMake(player1);
SendClientMessage(player1, COLOR_BLUE, "You have been made a police officer. Changes will appear on next death.");
}
}
} // where did that one come from?
return 1;
}


Thanks, but you added one closing bracket to much.
added by mistaken just remove it
I know.. oh by the way.. still not working :/
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)