SA-MP Forums Archive
All My Zcmd Return to id 0 - 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: All My Zcmd Return to id 0 (/showthread.php?tid=339530)



All My Zcmd Return to id 0 - [D]ry[D]esert - 03.05.2012

title Explain its self :\


Re: All My Zcmd Return to id 0 - Kindred - 03.05.2012

This was literary made today, please search before posting.

As the title explains, it's probably because of your sscanf (if you are using sscanf)

If not, show some code.


Re: All My Zcmd Return to id 0 - [D]ry[D]esert - 03.05.2012

Quote:
Originally Posted by Kindred
Посмотреть сообщение
This was literary made today, please search before posting.

As the title explains, it's probably because of your sscanf (if you are using sscanf)

If not, show some code.
Yeah i checked dat link , i do every step but The same nothing changed
and yes i am using sscanf so that won't make Zcmd Work ?


Re: All My Zcmd Return to id 0 - Kindred - 03.05.2012

So you followed all of the steps? Including the fact you have to recompile it after updating the plugin and so forth?

If it still doesn't work, then I guess your not doing it right or something, this is (i think) the only reason the ID 0 bug would happen if you use sscanf.


Re: All My Zcmd Return to id 0 - [D]ry[D]esert - 03.05.2012

Ah i will show some of my Zcommands
Код:
COMMAND:kick(playerid, params[])
{
    if(AccountInfo[playerid][AdminLevel] >= 2)
	{
	new targetid = strval(params);
	new pName[MAX_PLAYER_NAME];
	GetPlayerName(targetid, pName, sizeof(pName));
	if(!IsPlayerAdmin(playerid)) return 0;
	new reason[64], string[128];
	if(sscanf(params, "uz", targetid, reason)) return SendClientMessage(playerid, COLOR_BRIGHTRED, "Usage:{FFFFFF} /kick [playerid/partofname] [reason]"); // here it tells the player to use /kick playerid reason or /kick partofname reason
	if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "Player not connected or is yourself!");
    format(string, sizeof(string), "{FF0000}%s{FCFCFC} has been kicked by An Admin {FF0000}({FCFCFC}Reason:{09FF00} %s{FF0000})",pName, reason);
	SendClientMessageToAll(COLOR_YELLOW, string);
	Kick(targetid);
	}
	return 1;
}
COMMAND:ban(playerid, params[])
{
   if(AccountInfo[playerid][AdminLevel] >= 3)
	{
	new targetid = strval(params);
	new pName[MAX_PLAYER_NAME];
	GetPlayerName(targetid, pName, sizeof(pName));
	if(!IsPlayerAdmin(playerid)) return 0;
	new reason[64], string[128];
	if(sscanf(params, "uz", targetid, reason)) return SendClientMessage(playerid, COLOR_BRIGHTRED, "Usage:{FFFFFF} /ban [playerid/partofname] [reason]"); // here it tells the player to use /kick playerid reason or /kick partofname reason
	if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "Player not connected or is yourself!");
	format(string, sizeof(string), "{FF0000}%s{FCFCFC} has been banned by An Admin {FF0000}({FCFCFC}Reason:{09FF00} %s{FF0000})",pName, reason);
	SendClientMessageToAll(COLOR_YELLOW, string);
	Ban(targetid);
	}
return 1;
}
COMMAND:heal(playerid, params[])
{
    if(AccountInfo[playerid][AdminLevel] >= 2)
	{
		new id;
 		if (sscanf(params, "u", id)) return SendClientMessage(playerid, 0xFF0000AA, "Usage:{FFFFFF} \"/heal <playerid>\"");
		if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000AA, "Player not {FFFFFF}found");
		SetPlayerHealth(id, 100.0);
		SendClientMessage(id, 0x00FF00AA, "You have been healed");
		SendClientMessage(playerid, 0x00FF00AA, "Player healed");
	}
	else return SendClientMessage(playerid,COLOR_WHITE,"You Have To Be Admin Level {FFFFFF}1");
	return 1;
}



Re: All My Zcmd Return to id 0 - ViniBorn - 04.05.2012

It's sscanf or sscanf2 ?


Re: All My Zcmd Return to id 0 - [D]ry[D]esert - 04.05.2012

sscanf2


Re: All My Zcmd Return to id 0 - ReneG - 04.05.2012

In laymens, just uninstall everything, download latest, re-install, re-compile. Those are the steps you should always take when problems like these arise. There is always a reason behind something. Specifically in sa-mp scripting.


Re: All My Zcmd Return to id 0 - JaKe Elite - 04.05.2012

One suggestion
Why you putting GetPlayerName before the sscanf? Put it after the sscanf
Because if you have NPC in your server, the targetname will be the NPC Name.

Just suggesting.


Re: All My Zcmd Return to id 0 - Dragony92 - 04.05.2012

Update sscanf plugin and include...