15.12.2014, 17:13
on the top
somethimes when i wanna spawn a car after a few seconds it disappear. Also this happens to other players. It's very annoying. Can someone help?
Код:
enum aaInfo { bool:pCanSpawnVehicle, pSpawnVehicle, } new PlayerInfooo[MAX_PLAYERS][aaInfo]; new Float:upX, Float:upY, Float:upZ, Float:upAngle;
Код:
CMD:v(playerid, params[]) { new Vehicle[32], VehicleID, ColorOne, ColorTwo; PlayerInfooo[playerid][pCanSpawnVehicle] = true; if(sscanf(params, "s[32]D(1)D(1)", Vehicle, ColorOne, ColorTwo)) { PlayerInfooo[playerid][pCanSpawnVehicle] = true; SendClientMessage(playerid, WHITE, "[USAGE]: /v [Vehiclename/Vehicleid] [Color 1] [Color 2]"); return 1; } if(PlayerInfooo[playerid][pCanSpawnVehicle]) { VehicleID = GetVehicleModelIDFromName(Vehicle); if(VehicleID != 425 && VehicleID != 432 && VehicleID != 447 && VehicleID != 430 && VehicleID != 417 && VehicleID != 435 && VehicleID != 449 && VehicleID != 450 && VehicleID != 460 && VehicleID != 464 && VehicleID != 465 && VehicleID != 469 && VehicleID != 472 && VehicleID != 476 && VehicleID != 497 && VehicleID != 501 && VehicleID != 511 && VehicleID != 519 && VehicleID != 520 && VehicleID != 537 && VehicleID != 538 && VehicleID != 548 && VehicleID != 553 && VehicleID != 563 && VehicleID != 564 && VehicleID != 569 && VehicleID != 570 && VehicleID != 584 && VehicleID != 590 && VehicleID != 591 && VehicleID != 592 && VehicleID != 594 && VehicleID != 606 && VehicleID != 607 && VehicleID != 608 && VehicleID != 610 && VehicleID != 611) { if(VehicleID == -1 ) { VehicleID = strval(Vehicle); if(VehicleID < 400 || VehicleID > 611 ) { return SendClientMessage(playerid, RED, "You entered an invalid vehiclename!"); } } GetPlayerPos(playerid, upX, upY, upZ); GetPlayerFacingAngle(playerid, upAngle); DestroyVehicle(PlayerInfooo[playerid][pSpawnVehicle]); PlayerInfooo[playerid][pSpawnVehicle] = CreateVehicle(VehicleID, upX, upY, upZ+2.1, upAngle, ColorOne, ColorTwo, -1); LinkVehicleToInterior(PlayerInfooo[playerid][pSpawnVehicle], GetPlayerInterior(playerid)); PutPlayerInVehicle(playerid, PlayerInfooo[playerid][pSpawnVehicle], 0); } else { SendClientMessage(playerid, RED, "You are not allowed to spawn this vehicle!!"); } } else { SendClientMessage(playerid, RED, "You can not spawn vehicles in this zone!"); } return 1; }