Help my zcmd have bug
#1

I making RolePlay mod from scratch,and all i did #include zcmd....zcmd commands working without parametres,but when i making admin commands with [id] eg /akill [id]....I do everything right, but when I enter any id say / akill 1,2,3,4,5,6,7,8,9 etc. .. always kills me, here is my command. here is my code..

Код:
CMD:akill(playerid, params[])
{
	new
		id;
	if (sscanf(params, "u", id)) SendClientMessage(playerid, COLOR_CRIMSON, "Koristi: /akill [id]");
	else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_CRIMSON, "Greska igrac nije konektovan!");
	else
	{
		SetPlayerHealth(id, 0);
		SendClientMessage(id, COLOR_CRIMSON, "Ubijen si od strane admina!");
		SendClientMessage(playerid, COLOR_CRIMSON, "Igrac ubijen!");
	}
	return 1;
}
Reply
#2

pawn Код:
CMD:akill(playerid, params[])
{
    new
        id;
    if (sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_CRIMSON, "Koristi: /akill [id]");
    if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_CRIMSON, "Greska igrac nije konektovan!");
    SetPlayerHealth(id, 0);
    SendClientMessage(id, COLOR_CRIMSON, "Ubijen si od strane admina!");
    SendClientMessage(playerid, COLOR_CRIMSON, "Igrac ubijen!");
    return 1;
}
Reply
#3

Not working
Reply
#4

Hm. Are you sure you're using the latest SSCANF version?
EDIT: I've edited my code, try it now.
Reply
#5

Yes i have second mod with zcmd and in him this working
Reply
#6

Quote:
Originally Posted by nikolat007
Посмотреть сообщение
Yes i have second mod with zcmd and in him this working
Just woundering, did you compile the script, AKA, no errors?
Reply
#7

yes i did script have't errors
Reply
#8

pawn Код:
CMD:akill(playerid, params[])
{
    new id;
    if(!sscanf(params, "u", id))
    {
        SetPlayerHealth(id, 0);
        SendClientMessage(playerid, 0xFFFFFFFF, "You admin killed a player.");
        SendClientMessage(id, 0xFFFFFFFF, "You've been admin killed.");
        return 1;
    }
    else return SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /akill [PlayerID/PartOfName]");
}
Reply
#9

try r identifier
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)