27.04.2013, 14:40
Sure. I have built a barebones command for you. You will need to edit the script specific information (I just used the most generic information I could think of) and you will need to edit what you want to happen when time == 0 or some other number, but this is what it would look like using multiple parameters.
Also, quick warning: this code is not tested. While I'm eyeballing it and it looks good, it may contain an error. I would not recommend actually using this code as, like I said, it is just the 'example' you were asking for.
pawn Код:
COMMAND:freeze(playerid, params[])
{
new player, time, reason[128];
if(pInfo[playerid][Admin] < 1)
{
SendClientMessage(playerid, RED, "Error: You are not an admin");
}
else if(sscanf(params, "iis", player, time, reason ))
{
SendClientMessage(playerid, BLUE, "Syntax: /freeze [playerid] [time] [reason]");
}
else
{
if(time == 0)
{
// Freeze the player permanently.
}
else
{
// Freeze the player for 'time' using a timer.
}
}
return 1;
}