Advertisement
Guest User

Untitled

a guest
Jan 7th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. CMD:vcreate(playerid, params[])
  2. {
  3. if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first.");
  4. if(PlayerInfo[playerid][pAdmin] >= 5)
  5. {
  6. new id,model,string[128],giveplayer[30],total;
  7. if(sscanf(params, "ui", id, model)) return SCM(playerid, COLOR_GREY, "Syntax:{FFFFFF} /vcreate [playerid] [model]");
  8. if(model < 400 || model > 611) return SCM(playerid, COLOR_GREY, "Invalid car ID! (400-611)");
  9. if(IsPlayerConnected(id))
  10. {
  11. if(id != INVALID_PLAYER_ID)
  12. {
  13. for(new v; v < MAX_PERSONAL_CARS; v++)
  14. {
  15. if(PlayerInfo[id][pCar][v] != -1) total++;
  16. }
  17. if(total+1 > PlayerInfo[id][pCarSlots])
  18. {
  19. SendClientMessage(playerid, COLOR_GREY, "This player have all vehicles slots full.");
  20. return 1;
  21. }
  22. GetPlayerName(id, giveplayer, sizeof(giveplayer));
  23. CreateVEH[playerid] = model;
  24. CreateVEHID[playerid] = id;
  25. format(string, sizeof(string), "Esti sigur ca vrei sa-i dai lui %s masina %s?\n\nAbuzul de aceasta comanda poate duce la scoaterea ta din staff!", giveplayer, aVehicleNames[model - 400]);
  26. ShowPlayerDialog(playerid, DIALOG_VCREATE, DIALOG_STYLE_MSGBOX, "Personal Vehicle Create", string, "Da", "Nu");
  27. }
  28. }
  29. else return SendClientMessage(playerid, COLOR_GREY, "Player not connected.");
  30. }
  31. else return SendClientMessage(playerid, COLOR_LIGHTGREEN3, AdminOnly);
  32. return 1;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement