disarm cmd is bug help pls.
#1

Код:
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?
Reply
#2

Код:
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;
}
Reply
#3

my another friend helps me,
between thanks for the reply, i think ur is right as well, +rep ty
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)