TextDraw Help OnPlayerStateChange
#1

Hey I made a TextDraw for my Rent-A-Bike and Car business and I want it to be hidden when someone exits the vehicle (PLAYER_STATE_ONFOOT). I did it like this:

Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
	new string[256];
	new pveh = GetVehicleModel(GetPlayerVehicleID(playerid));
	new vehicle = GetPlayerVehicleID(playerid);
	if(newstate == PLAYER_STATE_DRIVER && (pveh != 509 && pveh != 481 && pveh != 510) && IsPlayerInAnyVehicle(playerid) && !IsAPlane(vehicle) && !IsAHarvest(vehicle) && !IsADrugHarvest(vehicle) && !IsASweeper(vehicle))
	{
		SetTimerEx("Startup", 1, false, "ii", playerid, vehicle);
		SetTimerEx("engine2", 2500, false, "ii", playerid);
	}
	else if(newstate == PLAYER_STATE_DRIVER && (pveh != 509 && pveh != 481 && pveh != 510) && IsPlayerInAnyVehicle(playerid) && !IsAPlane(vehicle) && !IsAHarvest(vehicle) && !IsADrugHarvest(vehicle) && !IsASweeper(vehicle))
	{
		SetTimerEx("Startup", 1, false, "ii", playerid, vehicle);
		SetTimerEx("engine2", 2500, false, "ii", playerid);
	}
	if(newstate == PLAYER_STATE_ONFOOT)
	{
	  TextDrawHideForPlayer(playerid,RentACarLogo);
	  TextDrawHideForPlayer(playerid,RentACarInfo);
	  TextDrawHideForPlayer(playerid,RentABikeLogo);
	  TextDrawHideForPlayer(playerid,RentABikeInfo);
	}
 	if(PlayerKarting[playerid] > 0 && PlayerInKart[playerid] > 0)
 	{
		  PlayerInKart[playerid] = 0;
		  KartingPlayers --;
		}
		  if(TransportDuty[playerid] > 0)
	 	{
		  if(TransportDuty[playerid] == 1)
			{
		    TaxiDrivers -= 1;
			}
			else if(TransportDuty[playerid] == 2)
			{
			  BusDrivers -= 1;
			}
			TransportDuty[playerid] = 0;
			format(string, sizeof(string), "You are now Off Duty and earned $%d.", TransportMoney[playerid]);
			SendClientMessage(playerid, COLOR_WHITE, string);
			SafeGivePlayerMoney(playerid, TransportMoney[playerid]);
			/*ConsumingMoney[playerid] = 1;*/ TransportValue[playerid] = 0; TransportMoney[playerid] = 0;
When I compile my Pawno client crashes. Please help!
Reply
#2

show complete script, you missed a couple brackets (pastebin).
Reply
#3

SetTimerEx("engine2", 2500, false, "ii", playerid);

Shouldn't there only be 1 'i'?

SetTimerEx("engine2", 2500, false, "i", playerid);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)