Can someone help me?
#1

Cand someone help me in my disarm .

When i use the command it only works on my or id 0

Код:
if(strcmp(cmd, "/disarm", true) == 0) // Reset the player's weapons
	{
		if (PlayerInfo[playerid][pAdmin] >= 1)
		{
      new giveplayerid;
      new giveplayer[MAX_PLAYER_NAME];
	    new sendername[MAX_PLAYER_NAME];
	    new giveplayername[MAX_PLAYER_NAME];
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_LIGHT_BLUE, "USAGE: /disarm [playername/id]");
				SendClientMessage(playerid, COLOR_LIGHT_BLUE, "FUNCTION: Will disarm the player.");
				return 1;
			}

			if(giveplayerid != INVALID_PLAYER_ID)
			{
			  GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
				GetPlayerName(playerid, sendername, sizeof(sendername));
			  ResetPlayerWeapons(giveplayerid);
				format(string, sizeof(string), "-| Administrator %s disarmed %s |-",sendername, giveplayername);
				ABroadCast(COLOR_YELLOW,string,1);
			}
			else if(giveplayerid == INVALID_PLAYER_ID)
			{
				format(string, sizeof(string), "%d is not an active player.", giveplayerid);
				SendClientMessage(playerid, COLOR_LIGHT_BLUE, string);
			}
		}
		else SendClientMessage(playerid, COLOR_LIGHT_BLUE, "You are not an admin with the required level.");
		return 1;
	}
Reply
#2

the command is from SWR ?
Reply
#3

Код:
if (PlayerInfo[playerid][pAdmin] >= 1)
i think that is the problem
Reply
#4

Quote:
Originally Posted by `'DokerJr'`
the command is from SWR ?
Is illegal to use his gm?

is not there SanMarino
Reply
#5

You never assign a value to giveplayerid.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)