Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1.  
  2. CMD:setscore(playerid, params[])
  3. {
  4. if (! IsPlayerAdminEx(playerid) && pStats[playerid][userAdmin] < 3)
  5. {
  6. return SendClientMessage(playerid, COLOR_TOMATO, "You must be admin level 3+ to use this command.");
  7. }
  8.  
  9. new targetid, amount;
  10. if (sscanf(params, "ui", targetid, amount))
  11. {
  12. return SendClientMessage(playerid, COLOR_THISTLE, "USAGE: /setscore [player] [amount]");
  13. }
  14.  
  15. if (! IsPlayerConnected(targetid))
  16. {
  17. return SendClientMessage(playerid, COLOR_TOMATO, "The specified player is not conected.");
  18. }
  19.  
  20. if (pStats[playerid][userAdmin] < pStats[targetid][userAdmin])
  21. {
  22. return SendClientMessage(playerid, COLOR_TOMATO, "You cannot use this command on higher level admin.");
  23. }
  24.  
  25. SetPlayerScore(targetid, amount);
  26. PlayerPlaySound(targetid, 1057, 0.0, 0.0, 0.0);
  27. PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  28.  
  29. new buf[150];
  30. format(buf, sizeof(buf), "Admin %s(%i) has set your score to %i.", ReturnPlayerName(playerid), playerid, amount);
  31. SendClientMessage(targetid, COLOR_DODGER_BLUE, buf);
  32. format(buf, sizeof(buf), "You have set %s(%i)'s score to %i.", ReturnPlayerName(targetid), targetid, amount);
  33. SendClientMessage(playerid, COLOR_DODGER_BLUE, buf);
  34. SendDC(CHANNEL_ID, "Admin %s(%i) has set score to %s(%i) Amount: %i .", ReturnPlayerName(playerid), playerid, ReturnPlayerName(targetid), targetid, amount);
  35. return 1;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement