18.02.2016, 10:07
Hello Guys
i Have Smail Problems
i made any Admins Can Spwan Vehicles from rank 1 to 8
Normal Player Can Spwan The Vehicles Why What is wrong
i Have Smail Problems
i made any Admins Can Spwan Vehicles from rank 1 to 8
Normal Player Can Spwan The Vehicles Why What is wrong
PHP код:
CMD:v(playerid, params[])
{
new Vehicle[32], VehicleID, ColorOne, ColorTwo;
PlayerInfov[playerid][pCanSpawnVehicle] = true;
if(sscanf(params, "s[32]D(1)D(1)", Vehicle, ColorOne, ColorTwo))
if(PlayerInfo[playerid][pRank] >= 1 && PlayerInfo[playerid][pRank] < 9)
{
PlayerInfov[playerid][pCanSpawnVehicle] = true;
SendClientMessage(playerid, COLOR_LIGHTYELLOW, "[USAGE]: /v[Vehiclename/Vehicleid] [Color 1 (optional)] [Color 2 (optional)]");
SendClientMessage(playerid, COLOR_LIGHTYELLOW, "[USAGE]: Like /v Turismo , /v Elegy /v Nrg /v 522");
return 1;
}
if(PlayerInfov[playerid][pCanSpawnVehicle])
{
VehicleID = GetVehicleModelIDFromName(Vehicle);
if(VehicleID != 425 && VehicleID != 432 && VehicleID != 447 &&
VehicleID != 430 && VehicleID != 417 && VehicleID != 435 &&
VehicleID != 446 && VehicleID != 449 && VehicleID != 450 &&
VehicleID != 452 && VehicleID != 453 && VehicleID != 454 &&
VehicleID != 460 && VehicleID != 464 && VehicleID != 465 &&
VehicleID != 469 && VehicleID != 472 && VehicleID != 473 &&
VehicleID != 476 && VehicleID != 484 && VehicleID != 487 &&
VehicleID != 488 && VehicleID != 493 && VehicleID != 497 &&
VehicleID != 501 && VehicleID != 511 && VehicleID != 512 &&
VehicleID != 513 && VehicleID != 519 && VehicleID != 520 &&
VehicleID != 537 && VehicleID != 538 && VehicleID != 548 &&
VehicleID != 553 && VehicleID != 563 && VehicleID != 564 &&
VehicleID != 569 && VehicleID != 570 && VehicleID != 577 &&
VehicleID != 584 && VehicleID != 590 && VehicleID != 591 &&
VehicleID != 592 && VehicleID != 593 && VehicleID != 594 &&
VehicleID != 595 && VehicleID != 606 && VehicleID != 607 &&
VehicleID != 608 && VehicleID != 610 && VehicleID != 611) {
if(VehicleID == -1 )
{
VehicleID = strval(Vehicle);
if(VehicleID < 400 || VehicleID > 611 )
{
return SendClientMessage(playerid, COLOR_RED, "You entered an invalid vehiclename!");
}
}
GetPlayerPos(playerid, pX, pY, pZ);
GetPlayerFacingAngle(playerid, pAngle);
DestroyVehicle(PlayerInfov[playerid][pSpawnVehicle]);
PlayerInfov[playerid][pSpawnVehicle] = CreateVehicle(VehicleID, pX, pY, pZ+2.0, pAngle, ColorOne, ColorTwo, -1);
LinkVehicleToInterior(PlayerInfov[playerid][pSpawnVehicle], GetPlayerInterior(playerid));
PutPlayerInVehicle(playerid, PlayerInfov[playerid][pSpawnVehicle], 0);
SendClientMessage(playerid, COLOR_RED, "You succesfully spawned this vehicle!");
} else {
SendClientMessage(playerid, COLOR_RED, "You are not allowed to spawn this vehicle!!");
}
} else {
SendClientMessage(playerid, COLOR_RED, "You can not spawn vehicles in this zone!");
}
return 1;
}