02.02.2011, 17:29
Anybody Give IRC !pm cmd !slap cmd and !players script
#include <a_samp>
#include <sscanf>
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(slap, 4, cmdtext);
return 0;
}
dcmd_slap(playerid, params[])
{
new targetid;
if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_USAGE, "USAGE: /slap (id)");
else if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_ERROR, "Invalid ID");
{
new playername[MAX_PLAYER_NAME], targetname[MAX_PLAYER_NAME], string[256];
GetPlayerName(playerid, playername, sizeof(playername));
GetPlayerName(targetid, targetname, sizeof(targetname));
format(string, sizeof(string), "Admin: %s(%d) slapped %s(%d)",playername, playerid, targetname, targetid);
SendClientMessageToAll(0xFF0000FF, string);
new Float:X, Float:Y, Float:Z;
SetPlayerPos(targetid, X, Y, Z + 10);
return 1;
}
}