Advertisement
Guest User

Untitled

a guest
May 6th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.30 KB | None | 0 0
  1. PlayerInfo[playerid][pObject][xx] = CreateDynamicObject(PhotoInfo[xx][obj_model], PhotoInfo[xx][obj_x], PhotoInfo[xx][obj_y], PhotoInfo[xx][obj_z], 0.00, 0.00, 0.00, -1, -1, playerid, 100.0);
  2.  
  3.  
  4. hook OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  5. {
  6. if(PRESSED(KEY_FIRE) && GetPlayerWeapon(playerid) == 43)
  7. {
  8. for(new xx = 1; xx <= questobjectss; xx++)
  9. {
  10. if(GetPlayerCameraMode(playerid) == 46 && GetPlayerCameraTargetDynObject(playerid) == PlayerInfo[playerid][pObject][xx])
  11. {
  12. if(PlayerInfo[playerid][pFoundObject][xx] == 0)
  13. {
  14. if(GetPVarInt(playerid, "pickup_time") && GetPVarInt(playerid, "pickup_time") > gettime())
  15. return SCMF(playerid, COLOR_GREY, "You need to wait %i seconds before photo another object.", GetPVarInt(playerid, "pickup_time")-gettime());
  16.  
  17. new string[128];
  18.  
  19. SetPVarInt(playerid, "pickup_time", 120+gettime());
  20.  
  21. DestroyDynamicObject(PlayerInfo[playerid][pObject][xx]);
  22. PlayerInfo[playerid][pObject][xx] = 0;
  23. PlayerInfo[playerid][pFoundObject][xx] = 1;
  24.  
  25. new objectsfound,query[256];
  26. mysql_format(SQL, query, sizeof(query), "UPDATE `users` SET `Object%d`='1' WHERE `name`='%s'", xx, PlayerInfo[playerid][pNormalName]);
  27. mysql_tquery(SQL, query, "", "");
  28.  
  29. for(new x; x <= questobjectss; x++)
  30. {
  31. if(PlayerInfo[playerid][pFoundObject][x] == 1) objectsfound++;
  32. }
  33. format(string, sizeof(string), "[quest updated]: %d/%d objects found", objectsfound, questobjectss);
  34. SCM(playerid, COLOR_ORANGE, string);
  35. if(objectsfound == questobjectss)
  36. {
  37. new name[30];
  38. GetPlayerName(playerid, name, sizeof(name));
  39. format(string, sizeof(string), "%s (%d) a gasit cele %d obiecte ascunse si a castigat un premiu special!", name, playerid);
  40. foreach(new p : Player)
  41. {
  42. SCM(p, COLOR_GREY, string);
  43. }
  44.  
  45. new money = 20*(PlayerInfo[playerid][pLevel] * (3000 + random(2000)));
  46. PlayerInfo[playerid][pAccount] += money;
  47. PlayerInfo[playerid][pExp] += 20;
  48. PlayerInfo[playerid][pRob] += 20;
  49. PlayerInfo[playerid][pHiddenColor] += 2;
  50. Update(playerid,pRP);
  51. Update(playerid,pRob);
  52. Update(playerid,pCashx);
  53. Update(playerid,pHiddenColorx);
  54.  
  55. SCM(playerid, -1, "-------------------------------------------------------");
  56. SCM(playerid, COLOR_ADMCHAT, "Ai completat quest-ul special si ai primit drept urmare:");
  57. SCM(playerid, COLOR_ADMCHAT, "20 Respect Poiunts, 20 Rob Points, 1 slot pentru vehicule, 2 culori hidden");
  58. SCM(playerid, -1, "-------------------------------------------------------");
  59.  
  60. new total,str2[256];
  61. for(new v; v < MAX_PERSONAL_VEHICLES; v++)
  62. {
  63. if(PlayerInfo[playerid][pCar][v] != -1) total++;
  64. }
  65. if(total+1 > PlayerInfo[playerid][pCarSlots])
  66. {
  67. if(PlayerInfo[playerid][pCarSlots] < MAX_PERSONAL_VEHICLES)
  68. {
  69. PlayerInfo[playerid][pCarSlots] += 1;
  70. mysql_format(SQL,str2,sizeof(str2),"UPDATE users SET `CarSlots`='%d' WHERE `name`='%s'",PlayerInfo[playerid][pCarSlots],PlayerInfo[playerid][pNormalName]);
  71. mysql_tquery(SQL,str2,"","");
  72. }
  73. }
  74. else SendClientMessage(playerid, COLOR_COOLRED, "ERROR: Maximum vehicle slots reached.");
  75. }
  76. }
  77. }
  78. }
  79. }
  80. return 1;
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement