zcmd + sscanf
#1

anttt
Reply
#2

this can help you : https://sampforum.blast.hk/showthread.php?tid=280387
Reply
#3

Yes but I have parameters with strtok and all, that's where I'm stuck.
Reply
#4

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;
}
Reply
#5

And playa = ReturnUserInc(tmp);
Reply
#6

playa is the targetid in Affan Codes

PHP код:
GetPlayerName(playagiveplayersizeof(giveplayer)); >> GetPlayerName(targetidtargetnamesizeof(targetname)); 
PHP код:
UnfreezePlayer(playa); >> UnfreezePlayer(targetid); 
Reply
#7

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.
Reply
#8

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.
Reply
#9

up please
Reply
#10

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".
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)