Advertisement
Guest User

Untitled

a guest
Mar 24th, 2012
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. CMD:slap(playerid, params[])
  2. {
  3. new idx,tmp[32];
  4. new giveplayerid, string[256];
  5. tmp = strtok(params, idx);
  6. if(!strlen(tmp))
  7. {
  8. SendClientMessage(playerid, COLOR_GREY, "USAGE: /slap [playerid]");
  9. return 1;
  10. }
  11. giveplayerid = strval(tmp);
  12. new Float:x, Float:y, Float:z;
  13. GetPlayerPos(giveplayerid, x, y, z);
  14. new Float:giveplayerhealth;
  15. GetPlayerHealth(giveplayerid, giveplayerhealth);
  16. if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 101)
  17. {
  18. SetPlayerPos(giveplayerid, x, y, z+10.0);
  19. SetPlayerHealth(giveplayerid, giveplayerhealth-5.0);
  20. format(string, sizeof(string), "[OperServ] %s Has been slapped by admin %s", PlayerName[giveplayerid], PlayerName[playerid]);
  21. SendClientMessageToAll(COLOR_RED, string);
  22. }
  23. else
  24. {
  25. SendClientMessage(playerid, COLOR_GREY, "You are not allowed to use this command.");
  26. }
  27. return 1;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement