Admin system
#9

It's kinda impossible to explain it without using code - So here's my go at it.

In sscanf you use specifiers, these specifiers help the system decide what you're trying to use as parameters; Like so:

pawn Код:
new Player;
if(sscanf(params, "u", Player)) //what happens if they just type "/commandname"?
    return SendClientMessage(playerid, -1, "Usage: /commandname [playerid]");
//what happens if they use the correct parameters?
new string[128], player_Name[MAX_PLAYER_NAME];
GetPlayerName(Player, player_Name, sizeof(player_Name));
format(string, sizeof(string), "You've typed: \"/commandname %d\", and have selected %s! (ID: %d)", Player, player_Name, Player);
SendClientMessage(playerid, -1, string); //Sends YOU this message.
In this example, "Player" is the ID you have selected, and "playerid" is the person who has typed the command.

I hope this helped.
Reply


Messages In This Thread
Admin system - by SpankMe2 - 04.08.2011, 19:09
Re: Admin system - by MadeMan - 04.08.2011, 19:11
Re: Admin system - by SpankMe2 - 04.08.2011, 19:16
Re: Admin system - by SpankMe2 - 04.08.2011, 19:18
Re: Admin system - by MadeMan - 04.08.2011, 19:22
Re: Admin system - by PrawkC - 04.08.2011, 19:22
Re: Admin system - by Tigerkiller - 04.08.2011, 19:24
Re: Admin system - by SpankMe2 - 04.08.2011, 19:25
Re: Admin system - by Scarred - 04.08.2011, 19:25

Forum Jump:


Users browsing this thread: 1 Guest(s)