11.01.2010, 17:15
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:
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.");
}

