Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:slap(playerid, params[])
- {
- new idx,tmp[32];
- new giveplayerid, string[256];
- tmp = strtok(params, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_GREY, "USAGE: /slap [playerid]");
- return 1;
- }
- giveplayerid = strval(tmp);
- new Float:x, Float:y, Float:z;
- GetPlayerPos(giveplayerid, x, y, z);
- new Float:giveplayerhealth;
- GetPlayerHealth(giveplayerid, giveplayerhealth);
- if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 101)
- {
- SetPlayerPos(giveplayerid, x, y, z+10.0);
- SetPlayerHealth(giveplayerid, giveplayerhealth-5.0);
- format(string, sizeof(string), "[OperServ] %s Has been slapped by admin %s", PlayerName[giveplayerid], PlayerName[playerid]);
- SendClientMessageToAll(COLOR_RED, string);
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "You are not allowed to use this command.");
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement