PNS Problem
#1

Код:
if(IsPlayerInRangeOfPoint(playerid, 4.0, 1024.8258, -1032.1052, 31.5072) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) // PNS 1
	{
		if(GetPlayerCash(playerid) < BizzInfo[10][bEntranceCost]) return SendClientMessage(playerid, COLOR_ERROR, "You don't have enough money.");
		format(gString, sizeof(gString), "~r~~h~-$%s", FormatNumber(BizzInfo[10][bEntranceCost]));
		GameTextForPlayer(playerid, gString, 1000, 1);
		GivePlayerCash(playerid, -BizzInfo[10][bEntranceCost]);
		BizzInfo[10][bSafe] += BizzInfo[10][bEntranceCost];
		bUpdate(10,bSafex);
		BizzPayLog(playerid, 10, BizzInfo[10][bEntranceCost]);

		SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), playerid+1);
		SetPlayerVirtualWorld(playerid, playerid+1);
    	foreach(new i : Player)
		{
			if(IsPlayerInVehicle(i, GetPlayerVehicleID(playerid))) SetPlayerVirtualWorld(i, playerid+1);
		}
		SetVehiclePos(GetPlayerVehicleID(playerid), 1025.1403, -1023.2640, 31.6690);
		SetVehicleZAngle(GetPlayerVehicleID(playerid), 360.0);
		TogglePlayerControllableEx(playerid, 0);
		SetTimerEx("AfterSpray", 4000, false, "ii", playerid, 1);
	}
	else if(IsPlayerInRangeOfPoint(playerid, 4.0, 2074.9380, -1831.1598, 13.1756) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) // PNS 2
	{
		if(GetPlayerCash(playerid) < BizzInfo[11][bEntranceCost]) return SendClientMessage(playerid, COLOR_ERROR, "You don't have enough money.");
		format(gString, sizeof(gString), "~r~~h~-$%s", FormatNumber(BizzInfo[11][bEntranceCost]));
		GameTextForPlayer(playerid, gString, 1000, 1);
		GivePlayerCash(playerid, -BizzInfo[11][bEntranceCost]);
		BizzInfo[11][bSafe] += BizzInfo[11][bEntranceCost];
		bUpdate(11,bSafex);
		BizzPayLog(playerid, 11, BizzInfo[11][bEntranceCost]);

		SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), playerid+1);
		SetPlayerVirtualWorld(playerid, playerid+1);
    	foreach(new i : Player)
		{
			if(IsPlayerInVehicle(i, GetPlayerVehicleID(playerid))) SetPlayerVirtualWorld(i, playerid+1);
		}
		SetVehiclePos(GetPlayerVehicleID(playerid), 2064.9763, -1831.3236, 13.1724);
		SetVehicleZAngle(GetPlayerVehicleID(playerid), 90.0);
		TogglePlayerControllableEx(playerid, 0);
		SetTimerEx("AfterSpray", 4000, false, "ii", playerid, 2);
	}
	else if(IsPlayerInRangeOfPoint(playerid, 4.0, 488.6419, -1731.3525, 10.8720) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) // PNS 3
	{
		if(GetPlayerCash(playerid) < BizzInfo[12][bEntranceCost]) return SendClientMessage(playerid, COLOR_ERROR, "You don't have enough money.");
		format(gString, sizeof(gString), "~r~~h~-$%s", FormatNumber(BizzInfo[12][bEntranceCost]));
		GameTextForPlayer(playerid, gString, 1000, 1);
		GivePlayerCash(playerid, -BizzInfo[12][bEntranceCost]);
		BizzInfo[12][bSafe] += BizzInfo[12][bEntranceCost];
		bUpdate(12,bSafex);
		BizzPayLog(playerid, 12, BizzInfo[12][bEntranceCost]);

		SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), playerid+1);
		SetPlayerVirtualWorld(playerid, playerid+1);
    	foreach(new i : Player)
		{
			if(IsPlayerInVehicle(i, GetPlayerVehicleID(playerid))) SetPlayerVirtualWorld(i, playerid+1);
		}
		SetVehiclePos(GetPlayerVehicleID(playerid), 487.4325, -1739.9144, 10.7542);
		SetVehicleZAngle(GetPlayerVehicleID(playerid), 170.0);
		TogglePlayerControllableEx(playerid, 0);
		SetTimerEx("AfterSpray", 4000, false, "ii", playerid, 3);
	}
	else if(IsPlayerInRangeOfPoint(playerid, 4.0, 720.0894, -464.7029, 16.3359) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) // PNS 4
	{
		if(GetPlayerCash(playerid) < BizzInfo[28][bEntranceCost]) return SendClientMessage(playerid, COLOR_ERROR, "You don't have enough money.");
		format(gString, sizeof(gString), "~r~~h~-$%s", FormatNumber(BizzInfo[28][bEntranceCost]));
		GameTextForPlayer(playerid, gString, 1000, 1);
		GivePlayerCash(playerid, -BizzInfo[28][bEntranceCost]);
		BizzInfo[28][bSafe] += BizzInfo[28][bEntranceCost];
		bUpdate(28,bSafex);
		BizzPayLog(playerid, 28, BizzInfo[28][bEntranceCost]);

		SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), playerid+1);
		SetPlayerVirtualWorld(playerid, playerid+1);
    	foreach(new i : Player)
		{
			if(IsPlayerInVehicle(i, GetPlayerVehicleID(playerid))) SetPlayerVirtualWorld(i, playerid+1);
		}
		SetVehiclePos(GetPlayerVehicleID(playerid), 720.2044, -458.1455, 15.9609);
		SetVehicleZAngle(GetPlayerVehicleID(playerid), 360.0);
		TogglePlayerControllableEx(playerid, 0);
		SetTimerEx("AfterSpray", 4000, false, "ii", playerid, 4);
	}
	return 1;
}
Why this has no effect ?
Please help me
Reply
#2

Instead of saying "this has no effect", go into detail with your problem. Example: "Nothing happens when I type this command". You can find further information on asking a good question here(click).

Obviously, you can expect few answers with this type of information being given. I'm guessing nothing is happening, if this is the case:
  • What have you done so far to try to debug the issue?
  • If you haven't debugged yet, add print labels throughout the script to see what's going on.
Reply
#3

You could put all of those pay and sprays into one segment of code. Also, you could put the whole thing into the OnEnterExitModShop callback.

https://sampwiki.blast.hk/wiki/OnEnterExitModShop
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)