Guest User

Untitled

a guest
May 6th, 2008
826
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public OnPlayerCommandText(playerid, cmdtext[])
  2. {
  3. dcmd(tazer,5, cmdtext);
  4. return 0;
  5. }
  6.  
  7. dcmd_tazer(playerid, params[])
  8. {
  9. new id, aName[24], str[128];
  10. if(IsPlayerAdmin(playerid))
  11. {
  12. if (sscanf(params, "d", id)) SendClientMessage(playerid, COLOUR_YELLOW, "Usage: \"/tazer [playerid]\"");
  13. else if (!IsPlayerConnected(id)) SendClientMessage(playerid, COLOUR_RED, "Invalid id");
  14. else
  15. {
  16. if(gTeam[playerid] == TEAM_COP) == 1 && gTeam[id] != TEAM_COP)
  17. {
  18. GetPlayerName(playerid, aName, 24);
  19. format(str, 128, "You have been tazered by %s", aName);
  20. SendClientMessage(id, 0xFFFF00FF, str);
  21. GivePlayerHealth(id, -50);
  22. ApplyAnimation(id, "WUZI", "CS_Dead_Guy", 1.0, 0, 0, 0, 0, 0);
  23. }
  24. }
  25. }
  26. else
  27. {
  28. SendClientMessage(playerid, COLOUR_RED, "Admins only!");
  29. }
  30. return 1;
  31. }
RAW Paste Data