02.09.2010, 18:36
Ok on my car system you type, /v get. Currently you can only spawn 1 car at a time, I'm curious of how i would go about making it so you can have 2 cars out at the same time. So i type /v get 1 and my first car spawns, Then i type /v get 2 and my second car spawns, Then when i type /v get 3, You already have 2 cars out please park one before spawning another one
pawn Код:
else if(!strcmp(tmp, "get",true)) {
new str[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /v get [number[1-5])");
return 1;
}
if(veh1[playerid] != 999 || veh2[playerid] != 999 || veh3[playerid] != 999 || veh4[playerid] != 999 || veh5[playerid] != 999 )
{
SendClientMessage(playerid, COLOR_LIGHTRED, " You already got a vehicle out , park it first!");
return 1;
}
if(strcmp(tmp, "1", true) == 0) {
if(IsVehicleSpawned(veh1[playerid])) {
SendClientMessage(playerid, COLOR_LIGHTRED, "You have already spawned your vehicle !");
new vZone[MAX_ZONE_NAME];
GetVehicleZone(veh1[playerid], vZone, MAX_ZONE_NAME);
format(string, sizeof(string), "Your %s is now in %s", VehicleNames[GetVehicleModel(veh1[playerid])-400], vZone);
SendClientMessage(playerid, COLOR_YELLOW, string);
return 1;
}
if(strcmp(PlayerInfo[playerid][pVeh1], "None", true)) {
format(str, sizeof(str), "Vehicles/Vehicles/%s.cfg",PlayerInfo[playerid][pVeh1]);
if(dini_Exists(str)) {
LoadVehicles(playerid, PlayerInfo[playerid][pVeh1]);
}
else SendClientMessage(playerid,COLOR_LIGHTRED, "You got bug with this vehicle please go to the admin");
return 1;
}
else {
SendClientMessage(playerid, COLOR_LIGHTRED, "You don't own any vehicle !");
return 1;
}
}
if(strcmp(tmp, "2", true) == 0) {
if(IsVehicleSpawned(veh2[playerid])) {
SendClientMessage(playerid, COLOR_LIGHTRED, "You have already spawned your vehicle !");
new vZone[MAX_ZONE_NAME];
GetVehicleZone(veh2[playerid], vZone, MAX_ZONE_NAME);
format(string, sizeof(string), "Your %s is now in %s", VehicleNames[GetVehicleModel(veh2[playerid])-400], vZone);
SendClientMessage(playerid, COLOR_YELLOW, string);
return 1;
}
if(strcmp(PlayerInfo[playerid][pVeh2], "None", true)) {
format(str, sizeof(str), "Vehicles/Vehicles/%s.cfg",PlayerInfo[playerid][pVeh2]);
if(dini_Exists(str)) {
LoadVehicles(playerid, PlayerInfo[playerid][pVeh2]);
}
else SendClientMessage(playerid,COLOR_LIGHTRED, "You got bug with this vehicle please go to the admin");
return 1;
}
else {
SendClientMessage(playerid, COLOR_LIGHTRED, "You don't have a 2nd vehicle!");
return 1;
}
}
if(strcmp(tmp, "3", true) == 0) {
if(IsVehicleSpawned(veh3[playerid])) {
SendClientMessage(playerid, COLOR_LIGHTRED, "You have already spawned your vehicle !");
new vZone[MAX_ZONE_NAME];
GetVehicleZone(veh3[playerid], vZone, MAX_ZONE_NAME);
format(string, sizeof(string), "Your %s is now in %s", VehicleNames[GetVehicleModel(veh3[playerid])-400], vZone);
SendClientMessage(playerid, COLOR_YELLOW, string);
return 1;
}
else {
if(strcmp(PlayerInfo[playerid][pVeh3], "None", true)) {
format(str, sizeof(str), "Vehicles/Vehicles/%s.cfg",PlayerInfo[playerid][pVeh3]);
if(dini_Exists(str)) {
LoadVehicles(playerid, PlayerInfo[playerid][pVeh3]);
}
else SendClientMessage(playerid,COLOR_LIGHTRED, "You got bug with this vehicle please go to the admin");
return 1;
}
else {
SendClientMessage(playerid, COLOR_LIGHTRED, "You don't have a 2nd vehicle!");
return 1;
}
}
}
if(strcmp(tmp, "4", true) == 0) {
if(IsVehicleSpawned(veh4[playerid])) {
SendClientMessage(playerid, COLOR_LIGHTRED, "You have already spawned your vehicle !");
new vZone[MAX_ZONE_NAME];
GetVehicleZone(veh4[playerid], vZone, MAX_ZONE_NAME);
format(string, sizeof(string), "Your %s is now in %s", VehicleNames[GetVehicleModel(veh4[playerid])-400], vZone);
SendClientMessage(playerid, COLOR_YELLOW, string);
return 1;
}
else {
if(strcmp(PlayerInfo[playerid][pVeh4], "None", true)) {
format(str, sizeof(str), "Vehicles/Vehicles/%s.cfg",PlayerInfo[playerid][pVeh4]);
if(dini_Exists(str)) {
LoadVehicles(playerid, PlayerInfo[playerid][pVeh4]);
}
else SendClientMessage(playerid,COLOR_LIGHTRED, "You got bug with this vehicle please go to the admin");
return 1;
}
else {
SendClientMessage(playerid, COLOR_LIGHTRED, "You don't have a 4th vehicle!");
return 1;
}
}
}
if(strcmp(tmp, "5", true) == 0) {
if(IsVehicleSpawned(veh5[playerid])) {
SendClientMessage(playerid, COLOR_LIGHTRED, "You have already spawned your vehicle !");
new vZone[MAX_ZONE_NAME];
GetVehicleZone(veh5[playerid], vZone, MAX_ZONE_NAME);
format(string, sizeof(string), "Your %s is now in %s", VehicleNames[GetVehicleModel(veh5[playerid])-400], vZone);
SendClientMessage(playerid, COLOR_YELLOW, string);
return 1;
}
if(strcmp(PlayerInfo[playerid][pVeh5], "None", true)) {
format(str, sizeof(str), "Vehicles/Vehicles/%s.cfg",PlayerInfo[playerid][pVeh5]);
if(dini_Exists(str)) {
LoadVehicles(playerid, PlayerInfo[playerid][pVeh5]);
}
else SendClientMessage(playerid,COLOR_LIGHTRED, "You got bug with this vehicle please go to the admin");
return 1;
}
else {
SendClientMessage(playerid, COLOR_LIGHTRED, "You don't have a 5th vehicle!!");
return 1;
}
}
return 1;
}