Advertisement
Guest User

Untitled

a guest
May 20th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.10 KB | None | 0 0
  1. CMD:join(playerid, params[])
  2. {
  3. for(new i = 0; i < sizeof(jobLocations); i ++)
  4. {
  5. if(IsPlayerInRangeOfPoint(playerid, 3.0, jobLocations[i][jobX], jobLocations[i][jobY], jobLocations[i][jobZ]))
  6. {
  7. if(PlayerInfo[playerid][pJob] != JOB_NONE)
  8. {
  9. if(PlayerInfo[playerid][pVIPPackage] >= 2)
  10. {
  11. if(PlayerInfo[playerid][pSecondJob] != JOB_NONE)
  12. {
  13. return SendClientMessage(playerid, COLOR_GREY, "You have two jobs already. Please quit one of them before getting another one.");
  14. }
  15. if(PlayerInfo[playerid][pJob] == i)
  16. {
  17. return SendClientMessage(playerid, COLOR_GREY, "You have this job already.");
  18. }
  19. mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET secondjob = %i WHERE uid = %i", i, PlayerInfo[playerid][pID]);
  20. mysql_tquery(connectionID, queryBuffer);
  21. ApplyActorAnimation(jobLocations[i][jobActor], "PED", "IDLE_CHAT", 4.1, 1, 1, 1, 1, 1);
  22. PlayerInfo[playerid][pSecondJob] = i;
  23. SendClientMessageEx(playerid, COLOR_WHITE, "You are now a {FF0000}%s{ffffff}. Use /jobhelp for a list of commands related to your new job.", jobLocations[i][jobName]);
  24. }
  25. else
  26. {
  27. SendClientMessage(playerid, COLOR_GREY, "You have a job already. Please quit your current job before getting another one.");
  28. }
  29.  
  30. return 1;
  31. }
  32.  
  33. mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET job = %i WHERE uid = %i", i, PlayerInfo[playerid][pID]);
  34. mysql_tquery(connectionID, queryBuffer);
  35. // ApplyActorAnimation(jobLocations[i][jobActor], "PED", "IDLE_CHAT", 4.1, 1, 1, 1, 1, 1);
  36. PlayerInfo[playerid][pJob] = i;
  37. SendClientMessageEx(playerid, COLOR_WHITE, "You are now a {ffff00}%s{ffffff}. Use /jobhelp for a list of commands related to your new job.", jobLocations[i][jobName]);
  38. return 1;
  39. }
  40. }
  41.  
  42. SendClientMessage(playerid, COLOR_GREY, "You are not in range of any job icon.");
  43. return 1;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement