05.02.2013, 15:59
Hi, I want, when a player enters in vehicle "574"(Sweeper). He'll start the job.
The problem is that no message is sent. Also the money is not sent to the player here is the code:
The problem is that no message is sent. Also the money is not sent to the player here is the code:
PHP Code:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
switch(vehicleid)
{
case 574:
{
SendClientMessage(playerid, -1, "You are now street sweeping to earn money. Drive around to get your money");
SetTimer("Sweeping", 10000, false);
}
}
return 1;
}
forward Sweeping(playerid);
public Sweeping(playerid)
{
new string[128];
new rand = 200 + random(500);
GivePlayerMoney(playerid, rand);
format(string, sizeof(string), "You have received $%d for your street sweeping job", rand);
SendClientMessage(playerid, -1, string);
return 1;
}