Hellrocker

Untitled

Dec 8th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. CMD:setcookies(playerid, params[])
  2. {
  3. if(User[playerid][accountAdmin] >= 1)
  4. {
  5. if(sscanf(params, "ui", pid, amount)) return SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "USAGE: /setcookies [Player ID] [Amount]");
  6. if(!IsPlayerConnected(pid)) return SendClientMessage(playerid, COLOR_RED, "PlayerID is not connected");
  7. PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  8. PlayerPlaySound(pid, 1057, 0.0, 0.0, 0.0);
  9. pInfo[playerid][Cookies] = 0;
  10. pInfo[pid][Cookies] += amount;
  11. format(str, sizeof(str), "* Admin %s (ID:%d) Set %s(ID:%d) cookies... %s has %d cookies",pName(playerid),playerid, pName(pid),pid,pName(pid),pInfo[pid][Cookies]);
  12. SendClientMessageToAll(COLOR_GREEN, str);
  13. }
  14. else
  15. {
  16. SendClientMessage(playerid, COLOR_RED, "-ERROR- Only admins can use this command.");
  17. }
  18. return 1;
  19. }
Add Comment
Please, Sign In to add comment