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;
}
else if(!strcmp(tmp, "get",true))
{
new str[256];
new vehcount;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /v get [number[1-5])");
return 1;
}
if(veh1[playerid] != 999) vehcount++;
if(veh2[playerid] != 999) vehcount++;
if(veh3[playerid] != 999) vehcount++;
if(veh4[playerid] != 999) vehcount++;
if(veh5[playerid] != 999) vehcount++;
if(vehcount >= 2) return SendClientMessage(playerid,COLOR_LIGHTRED,"You already have 2 cars out please park one before spawning another one"); // Player has 2 or more cars spawned, stop him from spawning more
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;
}
yes, you didn't have to rescirpt it for me, I just need to know how but thank you for the help. It's hard to get help on the forums nown days
|
It's only an example, I'm sure there are better ways of doing it!
![]() |