SA-MP Forums Archive
Help with Taxi System - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help with Taxi System (/showthread.php?tid=120485)



Help with Taxi System - Rensieboy14 - 11.01.2010

Hello,I have a scripting problem.
I want to make a taxi system.
But it won't work,please can someone help me to fix this?
I want to make a Taxi System, that if you enter the taxi as a passenger,the timer will start and you will lose money
Here is the code:
Код:
#include <a_samp>

new taxi = 1;
new timer = 0;
new timer1;

#define COLOR_GREEN 0x00A800AA

forward money(playerid);

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
  if(GetVehicleModel(vehicleid) == 420)
  {
    if (GetPlayerState(ispassenger) == 3)
    {
      timer1 = SetTimer("money",1000,true);
      timer = 1;
		}
    //SendClientMessage(playerid,COLOR_GREEN,"There is no Driver in this taxi.");
		//taxi = 1;
		//SendClientMessage(playerid,COLOR_GREEN,"You can now pickup people.");
	}
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
	if (timer == 1)
	{
    timer = 0;
    KillTimer(timer1);
	}
}

public money(playerid)
{
  GivePlayerMoney(playerid,-1);
  SendClientMessage(playerid,COLOR_GREEN,"You paid $1.");
}




Re: Help with Taxi System - Perker12345 - 11.01.2010

hi, what is the problem give more info


Re: Help with Taxi System - RyDeR` - 11.01.2010

Yeah, what do you want?


Re: Help with Taxi System - Rensieboy14 - 11.01.2010

I want to make a Taxi system that if you enter the taxi as a passenger,the timer starts and you lose money.


Re: Help with Taxi System - Perker12345 - 11.01.2010

Whats the problem with it then, for me it seems like it works..
Does it only remove 1 dollar or?


Re: Help with Taxi System - Rensieboy14 - 11.01.2010

This is how is should be:
If you enter a taxi as a passenger, every second you will lose $1.



Re: Help with Taxi System - Rensieboy14 - 11.01.2010

Help would be appreciated


Re: Help with Taxi System - Calgon - 11.01.2010

pawn Код:
SetTimerEx("money", 1000, true, "d", playerid);



Re: Help with Taxi System - Rensieboy14 - 11.01.2010

The timer is not starting :S


Re: Help with Taxi System - Calgon - 11.01.2010

Replace the previous SetTimer with the code I just provided.