CMD:slap(playerid,params[])
{
new id,msg[128],Float:x,Float:y,Float:z,name[MAX_PLAYER_NAME];
if(PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid,COLOR_RED,"[SERVER]:You must be and Admin to use this command!");
else if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_RED,"[SERVER]:Player is not connected anymore!");
else if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_RED,"[SERVER]:Usage:/slap [name/id]");
else
{
GetPlayerPos(id,x,y,z);
SetPlayerPos(id,x,y,z+4);
format(msg,sizeof(msg),"[SERVER]:You've been slapped by Admin %s!",GetPlayerName(playerid,name,sizeof(name)));
SendClientMessage(id,COLOR_RED,msg);
}
return 1;
}
format(msg,sizeof(msg),"[SERVER]:You've been slapped by Admin %s!",GetPlayerName(playerid,name,sizeof(name)));
SendClientMessage(id,COLOR_RED,msg);
COMMAND:slap(playerid,params[])
{
new OtherPlayer, Msg[150], Name[24], Message[150], OtherPlayerName[24];
SendAdminText(playerid,"/slap", params);
if (APlayerData[playerid][PlayerLevel] >= 2)
{
GetPlayerName(playerid, Name, sizeof(Name));
GetPlayerName(OtherPlayer, OtherPlayerName, sizeof(OtherPlayerName));
format(Msg, sizeof(MSg), "%s Slaps %s because %s", Name, OtherPlayerName, Message);
SendClientMessageToAll(0xFFFFFFFF, Msg);
SetPlayerHealth(OtherPlayer, 75);
}
else
{
return 0;
}
return 1;
}
dcmd_slap(playerid,params[]) { if(IsPlayerCommandLevel(playerid,"slap")) { if(!strlen(params)) return SendClientMessage(playerid,red,"Syntax Error: \"/SLAP <NICK OR ID>\"."); new id; if(!IsNumeric(params)) id = ReturnPlayerID(params); else id = strval(params); if(IsPlayerConnected(id) && id != INVALID_PLAYER_ID && id != playerid) { SendCommandMessageToAdmins(playerid,"SLAP"); new string[256],name[24],ActionName[24]; GetPlayerName(playerid,name,24); GetPlayerName(id,ActionName,24); format(string,256,"Administrator \"%s\" has bitch-slapped \"%s\".",name,ActionName); SendClientMessageToAll(yellow,string); new Float:Health; GetPlayerHealth(id,Health); return SetPlayerHealth(id,Health-Config[SlapDecrement]); } else return SendClientMessage(playerid,red,"ERROR: You can not slap yourself or a disconnected player."); } else return SendLevelErrorMessage(playerid,"slap"); }
GetPlayerName(playerid,name,sizeof(name));
format(msg,sizeof(msg),"[SERVER]:You've been slapped by Admin %s!",name);
Re-Compile Your FilterScripts If Its Admin System
Goto Server Folder >> pawno >> open pawno.exe then select filterscripts >> Compile it if i helper you plz +REP |
That's not the correct way of getting the name. Read the wiki: https://sampwiki.blast.hk/wiki/GetPlayerName
You get the name by storing it to an array and then using that array as argument. pawn Код:
Please don't.. just don't! Posting things that are not going to fix his problems, just to get +1 post and say about some points.. |
That's not the correct way of getting the name. Read the wiki: https://sampwiki.blast.hk/wiki/GetPlayerName
You get the name by storing it to an array and then using that array as argument. pawn Код:
Please don't.. just don't! Posting things that are not going to fix his problems, just to get +1 post and say about some points.. |