disarm cmd is bug help pls. - 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)
+--- Thread: disarm cmd is bug help pls. (
/showthread.php?tid=481322)
disarm cmd is bug help pls. -
ReD_HunTeR - 15.12.2013
Код:
CMD:disarm(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 2 || IsPlayerAdmin(playerid))
{
new targetid, string[128];
if(sscanf(params, "u", targetid)) SendClientMessage(playerid,COLOR_GREY,"Syntax: /disarm [playerid]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid,COLOR_RED,"Player is not online");
ResetPlayerWeapons(targetid);
format(string, sizeof(string), "%s %s has disarm your weapons",AdminLevelName(playerid),PlayerName(playerid));
SendClientMessage(targetid,COLOR_LIGHTBLUE,string);
}
else SendClientMessage(playerid,COLOR_RED,"You do not have the right admin permissions for this command!");
return 1;
}
bug:-
while just typing "/disarm" it disarm the player who have id 0 what is bug in it?
Re: disarm cmd is bug help pls. -
JoaoMonteiro452 - 15.12.2013
Код:
CMD:disarm(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 2 || IsPlayerAdmin(playerid))
{
new targetid, string[128];
if(sscanf(params, "u", targetid)) SendClientMessage(playerid,COLOR_GREY,"Syntax: /disarm [playerid]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid,COLOR_RED,"Player is not online");
ResetPlayerWeapons(targetid);
format(string, sizeof(string), "%s %s id: %i has disarm your weapons",AdminLevelName(playerid),PlayerName(targetid), playerid);
SendClientMessage(targetid,COLOR_LIGHTBLUE,string);
}
else SendClientMessage(playerid,COLOR_RED,"You do not have the right admin permissions for this command!");
return 1;
}
Re: disarm cmd is bug help pls. -
ReD_HunTeR - 15.12.2013
my another friend helps me,
between thanks for the reply, i think ur is right as well, +rep ty