zcmd + sscanf - 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 + sscanf (
/showthread.php?tid=531747)
zcmd + sscanf -
Baltimore - 14.08.2014
anttt
Re: zcmd + sscanf -
GGW - 14.08.2014
this can help you :
https://sampforum.blast.hk/showthread.php?tid=280387
Re : zcmd + sscanf -
Baltimore - 14.08.2014
Yes but I have parameters with strtok and all, that's where I'm stuck.
Re: zcmd + sscanf -
Affan - 14.08.2014
pawn Код:
CMD:unfreeze(playerid, params[])
{
new targetid, targetname[24]; // obvious
if(!pack_isAdmin(playerid, 1) return SendClientMessage(playerid, COLOR_ROUGE, noAcces);
if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "/unfreeze <id>"); // if you didn't type anything after /unfreeze , then message will be sent
if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_ROUGE, noConnected); // if ID is invalid, send error
GetPlayerName(targetid, targetname, sizeof(targetname));
UnfreezePlayer(targetid);
PlayerCuffed[targetid] = 0;
format(string, sizeof(string), "Le modйrateur/administrateur %s vous unfreeze.", pName[playerid]);
SendClientMessage(targetid, -1, string);
return 1;
}
Re : zcmd + sscanf -
Baltimore - 14.08.2014
And playa = ReturnUserInc(tmp);
Re: zcmd + sscanf -
GGW - 14.08.2014
playa is the targetid in Affan Codes
PHP код:
GetPlayerName(playa, giveplayer, sizeof(giveplayer)); >> GetPlayerName(targetid, targetname, sizeof(targetname));
PHP код:
UnfreezePlayer(playa); >> UnfreezePlayer(targetid);
Re: Re : zcmd + sscanf -
Affan - 14.08.2014
Quote:
Originally Posted by Baltimore
And playa = ReturnUserInc(tmp); 
|
What is ReturnUserInc ued for? Anyways, I don't find any need for that in there.
Re : zcmd + sscanf -
Baltimore - 14.08.2014
ReturnUserInc is a function which is used to return the id of a player who uses the nomoff.
the nomoff is a system that allows you to assign a number to an unknown player, so it has its "normal" id + id his unknown.
Re : zcmd + sscanf -
Baltimore - 14.08.2014
up please
Re: zcmd + sscanf -
Stinged - 14.08.2014
They already gave you the answer.
sscanf does everything for you.
Example:
pawn Код:
new id;
if (sscanf(params, "u", id))
return SendClientMessage(playerid, color, usage message);
Now you just use "id".