27.02.2012, 22:52
Quote:
pawn Код:
|
This is using ZCMD and sscanf. You should use it. It is fast, easy, and much more practical than using a string comparer as a command processor.
pawn Код:
CMD:cityhall(playerid,params[])
{
new targetid;
if(!IsPlayerAdmin(playerid)) //This is an Admin-Only command.
{
return SendClientMessage(playerid,0xFFFFFFFF," You are not authorized to use that command.");
}
if(sscanf(params,"i",targetid))
{
return SendClientMessage(playerid,0xFFFFFFFF,"USAGE: /cityhall [playerid]");
}
if(i == INVALID_PLAYER_ID)
{
return SendClientMessage(playerid,0xFFFFFFFF,"Player not found.");
}
else
{
new Admin[24],string[50];
GetPlayerName(playerid,Admin,sizeof(Admin));
format(string,sizeof(string),"Administrator %s has teleported you to City Hall.");
SendClientMessage(targetid,0xFFFFFFFF,string);
SetPlayerPos(targetid,1221.1116,-1814.8745,16.5938);
return 1;
}
return 1;
}