14.07.2010, 10:32
pawn Код:
COMMAND:pslap(playerid,params,cmdtext[]) {
new pId;
if(isprem[pId]==1) return SendClientMessage(playerid, COLOR_RED, "You used /pslap");
{
else
{
(isprem[pId]==0); SendClientMessage(playerid, COLOR_RED, "You arent a premium member");
new idx,tmp[256];
new sendername[MAX_PLAYER_NAME],giveplayer[MAX_PLAYER_NAME];
new string [128];
tmp = strtok(cmdtext, idx);
new otherplayer = strval(tmp);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /pslap [playerid]");
if(!IsPlayerConnected(otherplayer)) return SendClientMessage(playerid, COLOR_WHITE, "Invalid Player ID.");
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(otherplayer, giveplayer, sizeof(giveplayer));
new Float:X, Float:Y, Float:Z;
GetPlayerPos(otherplayer, X, Y, Z);
SetPlayerPos(otherplayer, X, Y, Z+10);
format(string, sizeof(string), "\"%s\" was slapped by Admin \"%s\".", giveplayer, sendername);
SendClientMessageToAll(COLOR_YELLOW, string);
}
return 1;
}