Help with Taxi System
#1

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.");
}

Reply
#2

hi, what is the problem give more info
Reply
#3

Yeah, what do you want?
Reply
#4

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

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

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

Help would be appreciated
Reply
#8

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

The timer is not starting :S
Reply
#10

Replace the previous SetTimer with the code I just provided.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)