Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. CMD:vipname(playerid, params[], help) {
  2. if(!IsPlayerInAnyVehicle(playerid)) return SCM(playerid, COLOR_GREY, "Nu esti in vehiculul tau!");
  3. new car = GetPlayerVehicleID(playerid);
  4. if(GetVehicles(playerid) == 0) return SCM(playerid, COLOR_LGREEN, "Eroare: Nu ai un vehicul personal!");
  5. if(PersonalCar(playerid) == -1) return SCM(playerid, COLOR_LGREEN, "Eroare: Nu esti in unul dintre vehiculele tale personale!");
  6. new idd = PersonalCar(playerid);
  7. if(CarInfo[idd][Spawned] != car) return SCM(playerid, COLOR_GREY, "Nu esti in vehiculul tau.");
  8. if(idd == 0) return SCM(playerid, COLOR_WHITE, "Acest vehicul nu iti apartine!");
  9. if(strlen(CarInfo[idd][cText]) < 3) return SCM(playerid, -1, "Acest vehicul nu este unul VIP!");
  10. new result[32];
  11. if(sscanf(params, "s[32]",result)) {
  12. SCM(playerid, COLOR_GREY, "USAGE: {FFFFFF}/vipname <name>");
  13. return 1;
  14. }
  15. if(strfind(result, "'", true) != -1 || strfind(result, "Model", true) != -1 || strfind(result, "`", true) != -1) return SCM(playerid, -1, "Caractere invalide!");
  16. if(strlen(result) < 3 || strlen(result) > 15) return SCM(playerid, COLOR_GREY, "Poti pune un text ce are minim 3 caractere si maxim 15.");
  17. if(strlen(CarInfo[idd][cText]) >= 3) DestroyDynamicObject(nameobject[CarInfo[idd][Spawned]]);
  18. format(CarInfo[idd][cText], 256, result);
  19. attach_vip_text(idd);
  20. new query[256], string[180];
  21. format(query, sizeof(query), "UPDATE `cars` SET `Text`='%s' WHERE `ID`='%d'", result, idd);
  22. mysql_query(SQL, query);
  23. format(string, sizeof(string), "Numele de pe spatele vehiculului este '%s'", result);
  24. SCM(playerid, COLOR_MONEY, string);
  25. return 1;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement