02.11.2013, 10:53
Try This
+REP IF HELPED
Код:
CMD:slap(playerid,params[])
{
new string[128];
new ID;
if(sscanf(params,"ui",ID))
{
SendClientMessage(playerid,COLOR_ERROR,"USAGE: /slap (Player Name/ID)");
return 1;
}
if(!IsPlayerConnected(ID))
{
format(string,sizeof(string),"The player ID (%d) is not connected to the server. You cannot give them Regular Player status.",ID);
SendClientMessage(playerid,COLOR_ERROR,string);
return 1;
}
if(IsKidnapped[playerid] == 1)
{
SendClientMessage(playerid,COLOR_ERROR,"You are kidnapped. You cannot use this command.");
return 1;
}
if(IsKidnapped[ID] == 1)
{
SendClientMessage(playerid,COLOR_ERROR,"This player is kidnapped. You cannot use this command.");
return 1;
}
if(!IsPlayerConnected(ID))
{
format(string,sizeof(string),"The Player ID (%d) is not connected to the server. You cannot cure them.",ID);
SendClientMessage(playerid,COLOR_ERROR,string);
return 1;
}
new Float:x,Float:y,Float:z;
GetPlayerPos(ID,x,y,z);
SetPlayerPos(ID,x,y,z+30);
SendClientMessage(ID,COLOR_DEADCONNECT,"[[_Slaped_]]");
format(string,sizeof(string),"[ADMIN ACTION]You have been slaped by %s(%d)",PlayerName(playerid),playerid);
SendClientMessage(ID,COLOR_ADMIN,string);
format(string,sizeof(string),"[ADMIN ACTION]You have Slaped %s(%d).",PlayerName(ID),ID);
SendClientMessage(playerid,COLOR_ADMIN,string);
format(string,sizeof(string),"3[ADMIN ACTION] %s(%d) has been slaped by %s(%d).",PlayerName(ID),ID,PlayerName(playerid),playerid);
IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
return 1;
}

