SA-MP Forums Archive
Can someone help me? - 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: Can someone help me? (/showthread.php?tid=102205)



Can someone help me? - Nexx - 14.10.2009

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;
	}



Re: Can someone help me? - DokerJr - 14.10.2009

the command is from SWR ?


Re: Can someone help me? - SanMarinoRP - 14.10.2009

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


Re: Can someone help me? - Nexx - 14.10.2009

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

is not there SanMarino


Re: Can someone help me? - yom - 14.10.2009

You never assign a value to giveplayerid.