Drug smuggler help
#1

I have a drug smuggler job in my gamemode but when the smuggler arrives to the checkpoint after purchasing the crates the checkpoint just dissappears and you get no money and you keep the crate does anyone know how to fix this I'll send you the code below:



Код:
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, 10.0, 2205.6875,1582.8101,999.9766))
				{
					mypoint = i;
				}
			}
			if (mypoint == -1)
			{
				SendClientMessageEx(playerid, COLOR_GREY, " You are not at the Drug Factory!");
				return 0;
			}
			if(PlayerInfo[playerid][pCrates])
			{
				SendClientMessageEx(playerid, COLOR_GREY, "   You can't hold any more Drug Crates!");
				SetPVarInt(playerid, "ChoosingDrugs", 0);
				return 0;
			}
			if(GetPlayerCash(playerid) > 1000)
			{
				SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* You bought some Drug Crates for $1000.");
				GivePlayerCash(playerid, -1000);
				PlayerInfo[playerid][pCrates] = 1;
				SetPVarInt(playerid, "CrateDeliver", 1);
				SetPVarInt(playerid, "ChoosingDrugs", 0);
				SetPVarInt(playerid, "tpDrugRunTimer", 45);
				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
			{
				SendClientMessageEx(playerid, COLOR_GREY," You can't afford the $1000!");
				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, 10.0, 2205.6875,1582.8101,999.9766))
				{
					mypoint = i;
				}
			}
			if (mypoint == -1)
			{
				SendClientMessageEx(playerid, COLOR_GREY, " You are not at the Drug Factory!");
				return 0;
			}
			if(PlayerInfo[playerid][pCrates])
			{
				SendClientMessageEx(playerid, COLOR_GREY, "   You can't hold any more drug crates!");
				SetPVarInt(playerid, "ChoosingDrugs", 0);
				return 0;
			}
			if(GetPlayerCash(playerid) > 1000)
			{
				SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* You bought some drug crates for $1000.");
				GivePlayerCash(playerid, -1000);
				PlayerInfo[playerid][pCrates] = 1;
				SetPVarInt(playerid, "CrateDeliver", 2);
				SetPVarInt(playerid, "ChoosingDrugs", 0);
				SetPVarInt(playerid, "tpDrugRunTimer", 45);
				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] += 500;
					}
				}
				return 0;
			}
			else
			{
				SendClientMessageEx(playerid, COLOR_GREY," You can't afford the $1000!");
				SetPVarInt(playerid, "ChoosingDrugs", 0);
   				return 0;
			}
		}
		else
		{
	 		SendClientMessageEx(playerid, COLOR_LIGHTRED,"What type of drugs would you like to smuggle? Type 'crack' or 'pot'.");
			return 0;
		}
	}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)