Advertisement
Guest User

Castle

a guest
May 26th, 2009
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. if(strcmp(cmd, "/addcar", true) == 0)
  2. {
  3. if(PlayerInfo[playerid][pAdmin] >= 1)
  4. {
  5. new ac;
  6. tmp = strtok(cmdtext, idx);
  7. if(!strlen(tmp)){ SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /addcar [Model] [Color1] [Color2]"); return 1; }
  8. new cModel = strval(tmp);
  9. tmp = strtok(cmdtext, idx);
  10. if(!strlen(tmp)){ SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /addcar [Model] [Color1] [Color2]"); return 1; }
  11. new cCol1 = strval(tmp);
  12. tmp = strtok(cmdtext, idx);
  13. if(!strlen(tmp)){ SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /addcar [Model] [Color1] [Color2]"); return 1; }
  14. new cCol2 = strval(tmp);
  15. new Float:acX, Float:acY, Float:acZ, Float:acA;
  16. GetPlayerPos(playerid, acX, acY, acZ);
  17. GetPlayerFacingAngle(playerid, acA);
  18. DynamicCars[ac][CarModel] = cModel;
  19. DynamicCars[ac][CarX] = acX;
  20. DynamicCars[ac][CarY] = acY;
  21. DynamicCars[ac][CarZ] = acZ;
  22. DynamicCars[ac][CarAngle] = acA;
  23. DynamicCars[ac][CarColor1] = cCol1;
  24. DynamicCars[ac][CarColor2] = cCol2;
  25. DynamicCars[ac][FactionCar] = 255;
  26. DynamicCars[ac][CarType] = 0;
  27. new car = CreateVehicle(DynamicCars[ac][CarModel],DynamicCars[ac][CarX],DynamicCars[ac][CarY],DynamicCars[ac][CarZ],DynamicCars[ac][CarAngle],DynamicCars[ac][CarColor1],DynamicCars[ac][CarColor2],-1);
  28. PutPlayerInVehicle(playerid,car,0);
  29. SaveDynamicCars();
  30. printf("Added Vehicle ID: %d, Vehicle Model: %d", car, cModel);
  31. return 1;
  32. }
  33. else{ SendClientMessage(playerid, COLOR_ADMINCMD, "You aren't authorized to use that command !"); return 1; }
  34. }
  35. if(strcmp(cmd, "/delcar", true) == 0)
  36. {
  37. if(PlayerInfo[playerid][pAdmin] >= 1337)
  38. {
  39. if(IsPlayerInAnyVehicle(playerid))
  40. {
  41. new ac = GetPlayerVehicleID(playerid);
  42. DestroyVehicle(ac);
  43. SaveDynamicCars();
  44. return 1;
  45. }
  46. }
  47. else{ SendClientMessage(playerid, COLOR_ADMINCMD, "You aren't authorized to use that command !"); return 1; }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement