SA-MP Forums Archive
Help my zcmd have bug - 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: Help my zcmd have bug (/showthread.php?tid=370779)



Help my zcmd have bug - nikolat007 - 21.08.2012

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



Re: Help my zcmd have bug - [MWR]Blood - 21.08.2012

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



Re: Help my zcmd have bug - nikolat007 - 21.08.2012

Not working


Re: Help my zcmd have bug - [MWR]Blood - 21.08.2012

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


Re: Help my zcmd have bug - nikolat007 - 21.08.2012

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


Re : Re: Help my zcmd have bug - ricardo178 - 21.08.2012

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?


Re: Help my zcmd have bug - nikolat007 - 21.08.2012

yes i did script have't errors


Re : Help my zcmd have bug - ricardo178 - 21.08.2012

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]");
}



Re: Help my zcmd have bug - aco_SRBIJA - 21.08.2012

try r identifier