SA-MP Forums Archive
ZCMD Help - 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: ZCMD Help (/showthread.php?tid=368465)



ZCMD Help - rexarlet - 13.08.2012

Код:
CMD:givemoney(playerid, params[])
{
	new targetid,type,string[128];
	if(sscanf(params, "ui", targetid, type)) return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: {FFFFFF}/givemoney [playerid] [amount]");
	if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "* This player is not in server..");
	if(type < 0 || type > 99999999) return SendClientMessage(playerid, COLOR_GREY, "* Cannot go under 0 or above 99999999.");
	if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, COLOR_GRAD1, "You are not ADMIN!");

	GivePlayerCash(targetid, type);
	format(string, sizeof(string),"AdmCmd: %s give player %s %d SAK", RPName( playerid ), RPName( targetid ), type);
	SendAdminMessage(COLOR_YELLOW,string);
	return 1;
}
I am not good at English so i will explain it with examples. When i use "/givemoney 0 1000" it says "this player is not in server.." but player is in server. Can anybody help me?


Re: ZCMD Help - ToiletDuck - 13.08.2012

pawn Код:
CMD:givemoney(playerid, params[])
{
    new targetid,type,string[128];
    if(sscanf(params, "ui", targetid, type)) return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: {FFFFFF}/givemoney [playerid] [amount]");
    if(IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "* This player is not in server..");
    if(type < 0 || type > 99999999) return SendClientMessage(playerid, COLOR_GREY, "* Cannot go under 0 or above 99999999.");
    if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, COLOR_GRAD1, "You are not ADMIN!");

    GivePlayerCash(targetid, type);
    format(string, sizeof(string),"AdmCmd: %s give player %s %d SAK", RPName( playerid ), RPName( targetid ), type);
    SendAdminMessage(COLOR_YELLOW,string);
    return 1;
}
Just remove the Exclamation point at the first of IsPlayerConnected(targetid))


Re: ZCMD Help - Snipa - 13.08.2012

Try
pawn Код:
if(sscanf(params, "ii", targetid, type)
and see if it still shows that problem.


Re: ZCMD Help - rexarlet - 13.08.2012

Quote:
Originally Posted by Snipa
Посмотреть сообщение
Try
pawn Код:
if(sscanf(params, "ii", targetid, type)
and see if it still shows that problem.
Thank you it works ^^


Re : ZCMD Help - Sandiel - 13.08.2012

Hmm, weird, playerid should be defined as "u" in sscanf, not as an integer (i,d)..