Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 KB | None | 0 0
  1. CMD:robcluckin(playerid, params[])
  2. {
  3. #pragma unused params
  4. if (Robbed[playerid] == 1) return SendClientMessage(playerid, COLOR_ERROR, "Command used recently... Please wait.");
  5. if (IsPlayerInCheckpoint(playerid) || GetPlayerInterior(playerid) == 9 || gTeam[playerid] == TEAM_CIVI || Robbed[playerid] == 0)
  6. {
  7. if (IsPlayerInRangeOfPoint(playerid, 2.0, 370.7102, -6.1440, 1001.8589))
  8. {
  9. new pName[MAX_PLAYER_NAME], str[128], rand, pFile[256], TmpZone[128];
  10. GetPlayerName(playerid, name, sizeof(name));
  11. format(file,sizeof(file),"/ACCOUNTS FOLDER/%s.ini",name);
  12. dini_IntSet(pFile, "RobSkill", PlayerInfo[playerid][RobSkill]+1);
  13. //SetPlayerScore(playerid, dini_Int(pFile, "Score"));
  14. //rand = random(400000);
  15. //GivePlayerMoney(playerid, rand);
  16. new robrand = random(400000);
  17. rand = robrand;
  18. GivePlayerMoney(playerid,robrand);
  19. format(str, sizeof(str), "|_ROBBERY_|: %s has recieved $%d from robbing Cluckin Bell!", pName, rand);
  20. SendClientMessageToAll(COLOR_GREEN, str);
  21. IRC_GroupSay(gGroupID, IRC_CHANNEL, str);
  22. format(pFile, sizeof(pFile), SERVER_USER_FILE, pName);
  23. SetPlayerScore(playerid, GetPlayerScore(playerid)+1);
  24. SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid)+4);
  25. SetTimer("Robbed1",100000,false);
  26. Robbed[playerid] = 1;
  27. dini_IntSet(pFile, "RobSkill", PlayerInfo[playerid][RobSkill]+1);
  28. dini_IntSet(pFile, "Score", PlayerInfo[playerid][Score]+1);
  29. for(new i = 0; i < MAX_PLAYERS; i++)
  30. {
  31. if(IsPlayerConnected(i))
  32. {
  33. if(gTeam[i] == TEAM_COPS || gTeam[i] == TEAM_ARMY)
  34. {
  35. GetPlayer3DZone(playerid, TmpZone, sizeof(TmpZone));
  36. format(str, sizeof(str), "|_STATION_|: (ROBBERY) %s(%d) Has robbed Cluckin Bell! Location: %s", pName, playerid, TmpZone);
  37. SendClientMessage(i, COLOR_BLUE, str);
  38. IRC_GroupSay(gGroupID, IRC_CHANNEL, str);
  39. }
  40. }
  41. }
  42. }
  43. }
  44. else if (!IsPlayerInCheckpoint(playerid)) return SendClientMessage(playerid, COLOR_ERROR, "ERROR: You're not in any checkpoint.");
  45. else if (gTeam[playerid] != TEAM_CIVI) return SendClientMessage(playerid, COLOR_ERROR, "Only civilians can rob.");
  46. return 1;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement