Advertisement
AlexOss

Untitled

Jan 22nd, 2019
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. CMD:rainbowcar(playerid, params[])
  2. {
  3. if(!IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) return SendClientMessage(playerid, -1, "This is not your pernosal car");
  4. {
  5. if(rainbowcar[playerid] == 0)
  6. {
  7. new getcarid = GetPlayerVehicleID(playerid);
  8. {
  9. new carid = PlayerInfo[playerid][pCarKey];
  10. if(CarInfo[carid][cRainbowC] == 0) return SendClientMessage(playerid, COLOR_WHITE,"This vehicle aren't rainbow color.");
  11. {
  12. SendClientMessage(playerid, COLOR_RED, "Rainbow Car has been turned on.");
  13. KillTimer(CTimer1);
  14. rainbowcar[playerid] = 1;
  15. CTimer1 = SetTimerEx("Color1", 500, 0, "d" ,playerid);
  16. }
  17. }
  18. }
  19. else
  20. {
  21. SendClientMessage(playerid, COLOR_RED, "Rainbow Car has been turned off.");
  22. KillTimer(CTimer1);
  23. rainbowcar[playerid] = 0;
  24. }
  25. }
  26. return 1;
  27. }
  28.  
  29.  
  30. new rainbowcar[MAX_PLAYERS],
  31. CTimer1;
  32.  
  33. la cinfo cRainbowC,
  34. onplayerconnect rainbowcar[playerid] = 0;
  35. \
  36. onplayerexitvehicle
  37. if(rainbowcar[playerid] == 1)
  38. {
  39. rainbowcar[playerid] = 0;
  40. }
  41. la /v
  42. case 10: {
  43. if(PlayerInfo[playerid][pPremiumPoints] < 100) return SCM(playerid, -1, "Nu ai destule puncte premium.");
  44. new carid = PlayerInfo[playerid][pCarKey];
  45. if(CarInfo[carid][cRainbowC] > 0) return SendClientMessage(playerid, COLOR_WHITE,"This vehicle already rainbow color.");
  46. CarInfo[carid][cRainbowC] = 1;
  47. new string2[184];
  48. mysql_format(SQL, string2, sizeof(string2), "UPDATE cars SET `RainbowC`='1' WHERE `ID`='%d'",CarInfo[carid][cID]);
  49. mysql_tquery(SQL,string2,"","");
  50. SCM(playerid, -1, "To enable, type /rainbowcar and to disable type /rainbowcar");
  51. PlayerInfo[playerid][pPremiumPoints] -= 100;
  52. Update(playerid, pPremiumPointsx);
  53. SendClientMessage(playerid, COLOR_YELLOW, "You upgraded this vehicle to rainbow color.(-100 pp)");
  54. }
  55.  
  56.  
  57. loadcar cache_get_field_content(i, "RainbowC", CarInfo[id][cRainbowC], SQL, 130);
  58. CarInfo[id][cRainbowC] = cache_get_field_content_int(i, "RainbowC");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement