17.04.2018, 14:32
So this is it, it's just only 2 options but iw anna make it three since i've 3 kinds of drugs which is Crack,Pot,Chemicals but there's no other way to deliver chemicals only this one..
Errors.
I also tried to remove "if" but still have an error and unable to compile
PHP код:
if(GetPVarInt(playerid, "ChoosingDrugs") == 1)
{
if(strcmp("pot", text, true) == 0)
{
new mypoint = -1;
for (new i=0; i<MAX_POINTS; i++)
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, Points[i][Pointx], Points[i][Pointy], Points[i][Pointz]) && strcmp(Points[i][Name], "Drug Factory", true) == 0)
{
mypoint = i;
}
}
if(mypoint == -1)
{
SendClientMessage(playerid, COLOR_GREY, "You're not at the Drug Factory!");
return 0;
}
if(PlayerInfo[playerid][pCrates])
{
SendClientMessage(playerid, COLOR_GREY, " You can't hold any more Drug Crates!");
SetPVarInt(playerid, "ChoosingDrugs", 0);
return 0;
}
if(CheckPointCheck(playerid))
{
SendClientMessage(playerid, COLOR_WHITE, "Please ensure that your current checkpoint is destroyed first (you either have material packages, or another existing checkpoint).");
return 0;
}
if(GetPlayerCash(playerid) >= 100)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE,"* You bought some Drug Crates for $100.");
GivePlayerCash(playerid, -100);
PlayerInfo[playerid][pCrates] = 1;
SetPVarInt(playerid, "CrateDeliver", 1);
SetPVarInt(playerid, "ChoosingDrugs", 0);
SetPVarInt(playerid, "tpDrugRunTimer", 25);
SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_TPDRUGRUNTIMER);
SetPlayerCheckpoint(playerid, 2166.3772,-1675.3829,15.0859, 3);
for(new i = 0; i < sizeof(FamilyInfo); i++)
{
if(strcmp(Points[mypoint][Owner], FamilyInfo[i][FamilyName], true) == 0)
{
FamilyInfo[i][FamilyBank] += 500;
}
}
return 0;
}
else
{
SendClientMessage(playerid, COLOR_GREY," You can't afford the $100!");
SetPVarInt(playerid, "ChoosingDrugs", 0);
return 0;
}
}
else if(strcmp("crack", text, true) == 0)
{
new mypoint = -1;
for (new i=0; i<MAX_POINTS; i++)
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, Points[i][Pointx], Points[i][Pointy], Points[i][Pointz]) && strcmp(Points[i][Name], "Drug Factory", true) == 0)
{
mypoint = i;
}
}
if(mypoint == -1)
{
SendClientMessage(playerid, COLOR_GREY, "You're not at the Drug Factory!");
return 0;
}
if(PlayerInfo[playerid][pCrates])
{
SendClientMessage(playerid, COLOR_GREY, " You can't hold any more drug crates!");
SetPVarInt(playerid, "ChoosingDrugs", 0);
return 0;
}
if(CheckPointCheck(playerid))
{
SendClientMessage(playerid, COLOR_WHITE, "Please ensure that your current checkpoint is destroyed first (you either have material packages, or another existing checkpoint).");
return 0;
}
if(GetPlayerCash(playerid) >= 100)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE,"* You bought some drug crates for $100.");
GivePlayerCash(playerid, -100);
PlayerInfo[playerid][pCrates] = 1;
SetPVarInt(playerid, "CrateDeliver", 2);
SetPVarInt(playerid, "ChoosingDrugs", 0);
SetPVarInt(playerid, "tpDrugRunTimer", 25);
SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_TPDRUGRUNTIMER);
SetPlayerCheckpoint(playerid, 2354.2808,-1169.2959,28.0066, 3);
for(new i = 0; i < sizeof(FamilyInfo); i++)
{
if(strcmp(Points[mypoint][Owner], FamilyInfo[i][FamilyName], true) == 0)
{
FamilyInfo[i][FamilyBank] += 50;
}
}
return 0;
}
else
{
SendClientMessage(playerid, COLOR_GREY," You can't afford the $100!");
SetPVarInt(playerid, "ChoosingDrugs", 0);
return 0;
}
}
else
{
SendClientMessageEx(playerid, COLOR_LIGHTRED,"What type of drugs would you like to smuggle? Type 'crack, pot or chemicals'.");
return 0;
}
else if(strcmp("chemicals", text, true) == 0)
{
new mypoint = -1;
for (new i=0; i<MAX_POINTS; i++)
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, Points[i][Pointx], Points[i][Pointy], Points[i][Pointz]) && strcmp(Points[i][Name], "Drug Factory", true) == 0)
{
mypoint = i;
}
}
if(mypoint == -1)
{
SendClientMessage(playerid, COLOR_GREY, "You're not at the Drug Factory!");
return 0;
}
if(PlayerInfo[playerid][pCrates])
{
SendClientMessage(playerid, COLOR_GREY, " You can't hold any more drug crates!");
SetPVarInt(playerid, "ChoosingDrugs", 0);
return 0;
}
if(CheckPointCheck(playerid))
{
SendClientMessage(playerid, COLOR_WHITE, "Please ensure that your current checkpoint is destroyed first (you either have material packages, or another existing checkpoint).");
return 0;
}
if(GetPlayerCash(playerid) >= 100)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE,"* You bought some drug crates for $100.");
GivePlayerCash(playerid, -100);
PlayerInfo[playerid][pCrates] = 1;
SetPVarInt(playerid, "CrateDeliver", 3);
SetPVarInt(playerid, "ChoosingDrugs", 0);
SetPVarInt(playerid, "tpDrugRunTimer", 25);
SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_TPDRUGRUNTIMER);
SetPlayerCheckpoint(playerid, 2354.2808,-1169.2959,28.0066, 3);
for(new i = 0; i < sizeof(FamilyInfo); i++)
{
if(strcmp(Points[mypoint][Owner], FamilyInfo[i][FamilyName], true) == 0)
{
FamilyInfo[i][FamilyBank] += 50;
}
}
return 0;
}
else
{
SendClientMessage(playerid, COLOR_GREY," You can't afford the $100!");
SetPVarInt(playerid, "ChoosingDrugs", 0);
return 0;
}
}
else
{
SendClientMessageEx(playerid, COLOR_LIGHTRED,"What type of drugs would you like to smuggle? Type 'crack, pot or chemicals'.");
return 0;
}
}
Код:
C:\Users\randypisonet\Documents\New folder\gamemodes\rrphz.pwn(68362) : warning 225: unreachable code C:\Users\randypisonet\Documents\New folder\gamemodes\rrphz.pwn(68362) : error 029: invalid expression, assumed zero C:\Users\randypisonet\Documents\New folder\gamemodes\rrphz.pwn(68362) : warning 215: expression has no effect C:\Users\randypisonet\Documents\New folder\gamemodes\rrphz.pwn(68362) : error 001: expected token: ";", but found "if"