25.08.2012, 09:42
The above example will output errors.
Note that -1 in SendClientMessage is white color, so change that if you want your colors.
pawn Код:
#include <a_samp>
#include <sscanf>
#include <zcmd>
COMMAND:setvw(playerid, params[])
{
#pragma unused params
if (IsPlayerAdmin(playerid))
{
new
targetid,
vw;
if (sscanf(params, "dd", targetid, vw))
{
SendClientMessage(playerid, -1, "Syntax: /setvw [playerid] [virtual world]");
return 1;
}
if (vw < 0)
{
SendClientMessage(playerid, -1, "Invalid virtual world specified.");
return 1;
}
if (!IsPlayerConnected(targetid))
{
SendClientMessage(playerid, -1, "Invalid player ID.");
return 1;
}
SetPlayerVirtualWorld(targetid, vw);
SendClientMessage(targetid, -1, "Your virtual world has been changed by an Admin.");
}
return 1;
}