warning 225: unreachable code helpme -
nooion345 - 02.03.2015
D:\Program Files\LSRP-TH 0.3z\gamemodes\LSRP-TH.pwn(38709) : warning 225: unreachable code
Pawn compiler 3.2.3664
Код:
if(strcmp(cmd, "/buycardonate", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!IsAtDealership(playerid))
{
return 1;
}
if(!strlen(tmp))
{
if(PlayerToPoint(3.0, playerid,535.4413,-1291.6403,17.2422))
{
SendClientMessage(playerid,COLOR_YELLOW2,",Caddy (50 Point) (457), Benson (50 Poin) (499),Dune (50 Poin) (573),Cement (50 Poin) (524)");
SendClientMessage(playerid,COLOR_YELLOW2,"Romero (100 Point) (442),Emperor (100 Poin) (585), Feltzer (100 Point) (533), Sultan (100 Point)");
SendClientMessage(playerid,COLOR_YELLOW2,"Freeway (150 Point) (463), Monster B (150 Point) (557), Sandking (150 Point) (495), Trashmaster (150 Point) (408)");
SendClientMessage(playerid,COLOR_YELLOW2," Hotknife (150 Point) (434), Hustler (150 Point) (545), Euros (150 Point) (587),Banshee (150) (429)");
SendClientMessage(playerid,COLOR_YELLOW2,"Sanchez (150 Point) (468), Bandito (200 Point) (568),Slamvan (200 Point) (535), ZR-350 (200 Point) (477)");
SendClientMessage(playerid,COLOR_YELLOW2,"Infernus (250 Point) (411), Turismo (250 Point) (451), NRG 500 (250 Point) (522)");
SendClientMessage(playerid,COLOR_YELLOW2,"Virgo (250 Point) (491), Jester (250 Point) (559), Bullet (250 Point) (541), Super GT (250 Point) (506)");
SendClientMessage(playerid,COLOR_YELLOW2,"FCR-900 (200 Point) (521), Quad (150 Point) (471), Wayfarer (150 Point) (586), Cheetah (150 Point) (415), Mower (200 Point) (572)");
}
SendClientMessage(playerid, COLOR_WHITE, "You aren't near enough to a dealership pickup.");
return 1;
}
SendClientMessage(playerid, COLOR_GRAD2, "{33CCFF}USAGE:{FFFFFF} /buyvehicle [ModelID] [ColorID] [ColorID]");
return 1;
}
new vehicle;
vehicle = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{33CCFF}USAGE:{FFFFFF} /buyvehicle [ModelID] [ColorID] [ColorID]");
return 1;
}
new color1;
color1 = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{33CCFF}USAGE:{FFFFFF} /buyvehicle [ModelID] [ColorID] [ColorID]");
return 1;
}
new buyvehpoint;
new color2;
color2 = strval(tmp);
if(color1 < 0 && color1 > 126)
{
SendClientMessage(playerid, COLOR_GREY, " Wrong color id!");
return 1;
}
if(color2 < 0 && color2 > 126)
{
SendClientMessage(playerid, COLOR_GREY, " Wrong color id!");
return 1;
}
if(PlayerToPoint(3.0, playerid,535.4413,-1291.6403,17.2422))
{
if(vehicle == 457) { buyvehpoint = 50; }
else if(vehicle == 499) { buyvehpoint = 50; }
else if(vehicle == 573) { buyvehpoint = 50; }
else if(vehicle == 524) { buyvehpoint = 50; }
else if(vehicle == 442) { buyvehpoint = 100; }
else if(vehicle == 585) { buyvehpoint = 100; }
else if(vehicle == 533) { buyvehpoint = 100; }
else if(vehicle == 463) { buyvehpoint = 150; }
else if(vehicle == 557) { buyvehpoint = 150; }
else if(vehicle == 495) { buyvehpoint = 150; }
else if(vehicle == 408) { buyvehpoint = 150; }
else if(vehicle == 434) { buyvehpoint = 150; }
else if(vehicle == 545) { buyvehpoint = 150; }
else if(vehicle == 587) { buyvehpoint = 150; }
else if(vehicle == 429) { buyvehpoint = 150; }
else if(vehicle == 468) { buyvehpoint = 150; }
else if(vehicle == 568) { buyvehpoint = 200; }
else if(vehicle == 535) { buyvehpoint = 200; }
else if(vehicle == 477) { buyvehpoint = 200; }
else if(vehicle == 411) { buyvehpoint = 250; }
else if(vehicle == 451) { buyvehpoint = 250; }
else if(vehicle == 522) { buyvehpoint = 250; }
else if(vehicle == 491) { buyvehpoint = 250; }
else if(vehicle == 559) { buyvehpoint = 250; }
else if(vehicle == 602) { buyvehpoint = 250; }
else if(vehicle == 541) { buyvehpoint = 250; }
else if(vehicle == 521) { buyvehpoint = 200; }
else if(vehicle == 471) { buyvehpoint = 150; }
else if(vehicle == 586) { buyvehpoint = 150; }
else if(vehicle == 415) { buyvehpoint = 150; }
else if(vehicle == 572) { buyvehpoint = 200; }
else { SendClientMessage(playerid,COLOR_GREY," Invalid ModelID !"); return 1; }
{
SendClientMessage(playerid, COLOR_RED, "You are not near any dealership!");
return 1;
}
if(ForwardOwnCar(1,playerid)) { SendClientMessage(playerid,COLOR_GREY,"You already have a vehicle spawned, Please /v despawn it"); return 1; }
else if(ForwardOwnCar(2,playerid)) { SendClientMessage(playerid,COLOR_GREY,"You already have a vehicle spawned, Please /v despawn it"); return 1; }
else if(ForwardOwnCar(3,playerid)) { SendClientMessage(playerid,COLOR_GREY,"You already have a vehicle spawned, Please /v despawn it"); return 1; }
if(PlayerInfo[playerid][pCarkey] != SCRIPT_CARS && PlayerInfo[playerid][pCarkey2] != SCRIPT_CARS && PlayerInfo[playerid][pCarkey3] != SCRIPT_CARS)
{
SendClientMessage(playerid,COLOR_GREY," You already have 3 key slots !");
return 1;
}
if(buyvehpoint == 0) { return 1; }
if(PlayerInfo[playerid][pDcoins] < buyvehpoint)
{
SendClientMessage(playerid,COLOR_GREY," ¤ШіБХѕНВдБиаѕХВ§ѕН !");
return 1;
}
new day,month,year;
getdate(year, month, day);
new found = 0;
for(new i = 0; i < sizeof(CarInfo); i++) //for(new i = 0; i < sizeof(CarInfo); i++)
{
if(found != 1)
{
if(CarInfo[i][cOwned] == 0)
{
found = 1;
CarInfo[i][cMod][0] = 0;
CarInfo[i][cMod][1] = 0;
CarInfo[i][cMod][2] = 0;
CarInfo[i][cMod][3] = 0;
CarInfo[i][cMod][4] = 0;
CarInfo[i][cMod][5] = 0;
CarInfo[i][cMod][6] = 0;
CarInfo[i][cMod][7] = 0;
CarInfo[i][cMod][8] = 0;
CarInfo[i][cMod][9] = 0;
if(PlayerInfo[playerid][pCarkey] == SCRIPT_CARS)
{
PlayerInfo[playerid][pCarkey] = i;
}
else if(PlayerInfo[playerid][pCarkey2] == SCRIPT_CARS)
{
PlayerInfo[playerid][pCarkey2] = i;
}
else if(PlayerInfo[playerid][pCarkey3] == SCRIPT_CARS)
{
PlayerInfo[playerid][pCarkey3] = i;
}
if(PlayerInfo[playerid][pDcoins] >= buyvehpoint && CanBuyDonateVeh[playerid] == 1)
{
PlayerInfo[playerid][pDcoins] -= buyvehpoint;
CarInfo[i][cvehDay] = day;
CarInfo[i][cvehMonth] = month+1;
CarInfo[i][cvehYear] = year;
if(CarInfo[i][cvehMonth] > 12)
{
CarInfo[i][cvehMonth] = 1;
CarInfo[i][cvehYear] = year+1;
}
}
else
{
CanBuyDonateVeh[playerid] = 0;
}
format(string, sizeof(string), "You have bought a %s, for %d Point.",VehicleName[vehicle-400],buyvehpoint);
SendClientMessage(playerid,COLOR_WHITE,string);
SendClientMessage(playerid,COLOR_WHITE,"remember to /v park your vehicle, Also /v for other commands.");
PlayerInfo[playerid][pDcoins]-= buyvehpoint;
CarInfo[i][cOwned] = 1;
CarInfo[i][cModel] = vehicle;
format(string, sizeof(string), "%s",VehicleName[vehicle-400]);
strmid(CarInfo[i][cDescription], string, 0, strlen(string), 255);
//CarInfo[i][cValue] = buyvehpoint;
CarInfo[i][cColorOne] = color1;
CarInfo[i][cColorTwo] = color2;
CarInfo[i][cLock] = 0;
new Float:yx,Float:yy,Float:yz,Float:urangle;
GetPlayerPos(playerid, yx, yy, yz);
GetPlayerFacingAngle(playerid,urangle);
CarInfo[i][cLocationx] = yx;
CarInfo[i][cLocationy] = yy;
CarInfo[i][cLocationz] = yz;
CarInfo[i][cAngle] = urangle;
CarInfo[i][cDonate] = 1;
CanBuyDonateVeh[playerid] = 1;
CarInfo[i][cFuel] = 100;
CarInfo[i][cTrunkWep][1] = 0;
CarInfo[i][cTrunkWep][2] = 0;
CarInfo[i][cTrunkWep][3] = 0;
CarInfo[i][cTrunkWep][4] = 0;
CarInfo[i][cTrunkAmmo][1] = 0;
CarInfo[i][cTrunkAmmo][2] = 0;
CarInfo[i][cTrunkAmmo][3] = 0;
CarInfo[i][cTrunkAmmo][4] = 0;
CarInfo[i][cTrunkArmour] = 0.0;
CarInfo[i][cTrunkCounter] = 0;
CarInfo[i][cvehDay] = 0;
CarInfo[i][cvehMonth] = 0;
CarInfo[i][cvehYear] = 0;
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s", sendername);
strmid(CarInfo[i][cOwner], string, 0, strlen(string), 255);
new carid = AddStaticVehicleEx(CarInfo[i][cModel],CarInfo[i][cLocationx],CarInfo[i][cLocationy],CarInfo[i][cLocationz]+1,CarInfo[i][cAngle],CarInfo[i][cColorOne],CarInfo[i][cColorTwo],3600);
VehicleOwned[carid] = i;
SaveCars();
return 1;
}
}
}
if(found != 1)
{
SendClientMessage(playerid, COLOR_WHITE, "Sorry, all the Vehicle Slots have been used please inform an admin.");
}
}
return 1;
}
line 38709
if(ForwardOwnCar(1,playerid)) { SendClientMessage(playerid,COLOR_GREY,"You already have a vehicle spawned, Please /v despawn it"); return 1; }
Re: warning 225: unreachable code helpme -
MikE1990 - 02.03.2015
I can't read this code please read this
https://sampforum.blast.hk/showthread.php?tid=563078
Re: warning 225: unreachable code helpme -
X337 - 02.03.2015
Try this, hope it work ..
Код:
if(strcmp(cmd, "/buycardonate", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!IsAtDealership(playerid))
{
return 1;
}
if(!strlen(tmp))
{
if(PlayerToPoint(3.0, playerid,535.4413,-1291.6403,17.2422))
{
SendClientMessage(playerid,COLOR_YELLOW2,",Caddy (50 Point) (457), Benson (50 Poin) (499),Dune (50 Poin) (573),Cement (50 Poin) (524)");
SendClientMessage(playerid,COLOR_YELLOW2,"Romero (100 Point) (442),Emperor (100 Poin) (585), Feltzer (100 Point) (533), Sultan (100 Point)");
SendClientMessage(playerid,COLOR_YELLOW2,"Freeway (150 Point) (463), Monster B (150 Point) (557), Sandking (150 Point) (495), Trashmaster (150 Point) (408)");
SendClientMessage(playerid,COLOR_YELLOW2," Hotknife (150 Point) (434), Hustler (150 Point) (545), Euros (150 Point) (587),Banshee (150) (429)");
SendClientMessage(playerid,COLOR_YELLOW2,"Sanchez (150 Point) (468), Bandito (200 Point) (568),Slamvan (200 Point) (535), ZR-350 (200 Point) (477)");
SendClientMessage(playerid,COLOR_YELLOW2,"Infernus (250 Point) (411), Turismo (250 Point) (451), NRG 500 (250 Point) (522)");
SendClientMessage(playerid,COLOR_YELLOW2,"Virgo (250 Point) (491), Jester (250 Point) (559), Bullet (250 Point) (541), Super GT (250 Point) (506)");
SendClientMessage(playerid,COLOR_YELLOW2,"FCR-900 (200 Point) (521), Quad (150 Point) (471), Wayfarer (150 Point) (586), Cheetah (150 Point) (415), Mower (200 Point) (572)");
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You aren't near enough to a dealership pickup.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "{33CCFF}USAGE:{FFFFFF} /buyvehicle [ModelID] [ColorID] [ColorID]");
return 1;
}
new vehicle;
vehicle = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{33CCFF}USAGE:{FFFFFF} /buyvehicle [ModelID] [ColorID] [ColorID]");
return 1;
}
new color1;
color1 = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{33CCFF}USAGE:{FFFFFF} /buyvehicle [ModelID] [ColorID] [ColorID]");
return 1;
}
new buyvehpoint;
new color2;
color2 = strval(tmp);
if(color1 < 0 && color1 > 126)
{
SendClientMessage(playerid, COLOR_GREY, " Wrong color id!");
return 1;
}
if(color2 < 0 && color2 > 126)
{
SendClientMessage(playerid, COLOR_GREY, " Wrong color id!");
return 1;
}
if(PlayerToPoint(3.0, playerid,535.4413,-1291.6403,17.2422))
{
if(vehicle == 457) { buyvehpoint = 50; }
else if(vehicle == 499) { buyvehpoint = 50; }
else if(vehicle == 573) { buyvehpoint = 50; }
else if(vehicle == 524) { buyvehpoint = 50; }
else if(vehicle == 442) { buyvehpoint = 100; }
else if(vehicle == 585) { buyvehpoint = 100; }
else if(vehicle == 533) { buyvehpoint = 100; }
else if(vehicle == 463) { buyvehpoint = 150; }
else if(vehicle == 557) { buyvehpoint = 150; }
else if(vehicle == 495) { buyvehpoint = 150; }
else if(vehicle == 408) { buyvehpoint = 150; }
else if(vehicle == 434) { buyvehpoint = 150; }
else if(vehicle == 545) { buyvehpoint = 150; }
else if(vehicle == 587) { buyvehpoint = 150; }
else if(vehicle == 429) { buyvehpoint = 150; }
else if(vehicle == 468) { buyvehpoint = 150; }
else if(vehicle == 568) { buyvehpoint = 200; }
else if(vehicle == 535) { buyvehpoint = 200; }
else if(vehicle == 477) { buyvehpoint = 200; }
else if(vehicle == 411) { buyvehpoint = 250; }
else if(vehicle == 451) { buyvehpoint = 250; }
else if(vehicle == 522) { buyvehpoint = 250; }
else if(vehicle == 491) { buyvehpoint = 250; }
else if(vehicle == 559) { buyvehpoint = 250; }
else if(vehicle == 602) { buyvehpoint = 250; }
else if(vehicle == 541) { buyvehpoint = 250; }
else if(vehicle == 521) { buyvehpoint = 200; }
else if(vehicle == 471) { buyvehpoint = 150; }
else if(vehicle == 586) { buyvehpoint = 150; }
else if(vehicle == 415) { buyvehpoint = 150; }
else if(vehicle == 572) { buyvehpoint = 200; }
else { SendClientMessage(playerid,COLOR_GREY," Invalid ModelID !"); return 1; }
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not near any dealership!");
return 1;
}
if(ForwardOwnCar(1,playerid)) { SendClientMessage(playerid,COLOR_GREY,"You already have a vehicle spawned, Please /v despawn it"); return 1; }
else if(ForwardOwnCar(2,playerid)) { SendClientMessage(playerid,COLOR_GREY,"You already have a vehicle spawned, Please /v despawn it"); return 1; }
else if(ForwardOwnCar(3,playerid)) { SendClientMessage(playerid,COLOR_GREY,"You already have a vehicle spawned, Please /v despawn it"); return 1; }
if(PlayerInfo[playerid][pCarkey] != SCRIPT_CARS && PlayerInfo[playerid][pCarkey2] != SCRIPT_CARS && PlayerInfo[playerid][pCarkey3] != SCRIPT_CARS)
{
SendClientMessage(playerid,COLOR_GREY," You already have 3 key slots !");
return 1;
}
if(buyvehpoint == 0) { return 1; }
if(PlayerInfo[playerid][pDcoins] < buyvehpoint)
{
SendClientMessage(playerid,COLOR_GREY," ¤ШіБХѕНВдБиаѕХВ§ѕН !");
return 1;
}
new day,month,year;
getdate(year, month, day);
new found = 0;
for(new i = 0; i < sizeof(CarInfo); i++) //for(new i = 0; i < sizeof(CarInfo); i++)
{
if(found != 1)
{
if(CarInfo[i][cOwned] == 0)
{
found = 1;
CarInfo[i][cMod][0] = 0;
CarInfo[i][cMod][1] = 0;
CarInfo[i][cMod][2] = 0;
CarInfo[i][cMod][3] = 0;
CarInfo[i][cMod][4] = 0;
CarInfo[i][cMod][5] = 0;
CarInfo[i][cMod][6] = 0;
CarInfo[i][cMod][7] = 0;
CarInfo[i][cMod][8] = 0;
CarInfo[i][cMod][9] = 0;
if(PlayerInfo[playerid][pCarkey] == SCRIPT_CARS)
{
PlayerInfo[playerid][pCarkey] = i;
}
else if(PlayerInfo[playerid][pCarkey2] == SCRIPT_CARS)
{
PlayerInfo[playerid][pCarkey2] = i;
}
else if(PlayerInfo[playerid][pCarkey3] == SCRIPT_CARS)
{
PlayerInfo[playerid][pCarkey3] = i;
}
if(PlayerInfo[playerid][pDcoins] >= buyvehpoint && CanBuyDonateVeh[playerid] == 1)
{
PlayerInfo[playerid][pDcoins] -= buyvehpoint;
CarInfo[i][cvehDay] = day;
CarInfo[i][cvehMonth] = month+1;
CarInfo[i][cvehYear] = year;
if(CarInfo[i][cvehMonth] > 12)
{
CarInfo[i][cvehMonth] = 1;
CarInfo[i][cvehYear] = year+1;
}
}
else
{
CanBuyDonateVeh[playerid] = 0;
}
format(string, sizeof(string), "You have bought a %s, for %d Point.",VehicleName[vehicle-400],buyvehpoint);
SendClientMessage(playerid,COLOR_WHITE,string);
SendClientMessage(playerid,COLOR_WHITE,"remember to /v park your vehicle, Also /v for other commands.");
PlayerInfo[playerid][pDcoins]-= buyvehpoint;
CarInfo[i][cOwned] = 1;
CarInfo[i][cModel] = vehicle;
format(string, sizeof(string), "%s",VehicleName[vehicle-400]);
strmid(CarInfo[i][cDescription], string, 0, strlen(string), 255);
//CarInfo[i][cValue] = buyvehpoint;
CarInfo[i][cColorOne] = color1;
CarInfo[i][cColorTwo] = color2;
CarInfo[i][cLock] = 0;
new Float:yx,Float:yy,Float:yz,Float:urangle;
GetPlayerPos(playerid, yx, yy, yz);
GetPlayerFacingAngle(playerid,urangle);
CarInfo[i][cLocationx] = yx;
CarInfo[i][cLocationy] = yy;
CarInfo[i][cLocationz] = yz;
CarInfo[i][cAngle] = urangle;
CarInfo[i][cDonate] = 1;
CanBuyDonateVeh[playerid] = 1;
CarInfo[i][cFuel] = 100;
CarInfo[i][cTrunkWep][1] = 0;
CarInfo[i][cTrunkWep][2] = 0;
CarInfo[i][cTrunkWep][3] = 0;
CarInfo[i][cTrunkWep][4] = 0;
CarInfo[i][cTrunkAmmo][1] = 0;
CarInfo[i][cTrunkAmmo][2] = 0;
CarInfo[i][cTrunkAmmo][3] = 0;
CarInfo[i][cTrunkAmmo][4] = 0;
CarInfo[i][cTrunkArmour] = 0.0;
CarInfo[i][cTrunkCounter] = 0;
CarInfo[i][cvehDay] = 0;
CarInfo[i][cvehMonth] = 0;
CarInfo[i][cvehYear] = 0;
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s", sendername);
strmid(CarInfo[i][cOwner], string, 0, strlen(string), 255);
new carid = AddStaticVehicleEx(CarInfo[i][cModel],CarInfo[i][cLocationx],CarInfo[i][cLocationy],CarInfo[i][cLocationz]+1,CarInfo[i][cAngle],CarInfo[i][cColorOne],CarInfo[i][cColorTwo],3600);
VehicleOwned[carid] = i;
SaveCars();
return 1;
}
}
}
if(found != 1)
{
SendClientMessage(playerid, COLOR_WHITE, "Sorry, all the Vehicle Slots have been used please inform an admin.");
}
}
return 1;
}
Re: warning 225: unreachable code helpme -
MikE1990 - 02.03.2015
Try this code
Код:
if(ForwardOwnCar(1,playerid))
{
SendClientMessage(playerid,COLOR_GREY,"You already have a vehicle spawned, Please /v despawn it");
}
else if(ForwardOwnCar(2,playerid))
{
SendClientMessage(playerid,COLOR_GREY,"You already have a vehicle spawned, Please /v despawn it");
}
else if(ForwardOwnCar(3,playerid))
{
SendClientMessage(playerid,COLOR_GREY,"You already have a vehicle spawned, Please /v despawn it");
}
Re: warning 225: unreachable code helpme -
nooion345 - 02.03.2015
thank you all very much ^^