13.10.2012, 16:28
Make a SetTimerEx
SetTimerEx("RentPlati", 60000, 1, "i", playerid);
Edit: BTW, it's now each 2 mins, it's each min that you need to pay. 60000 miliseconds is 1 minute
Edit2:
Try this:
SetTimerEx("RentPlati", 60000, 1, "i", playerid);
Edit: BTW, it's now each 2 mins, it's each min that you need to pay. 60000 miliseconds is 1 minute
Edit2:
Try this:
Код:
new renttimer[MAX_PLAYERS];
#define RENTANJE 991
new RentCar[19];
forward IsARentCar(carid);
forward RentPlati(playerid);
if(dialogid == RENTANJE)
{
if(response)
{
renttimer[playerid] = SetTimerEx("RentPlati", 60000, 1, "i", playerid);
SendClientMessage(playerid, COLOR_INFO, "INFO:{FFFFFF}You can ride now");
}
else
{
RemovePlayerFromVehicle(playerid);
}
}
public OnPlayerExitVehicle(playerid)
{
KillTimer(renttimer[playerid]);
return 1;
}
public IsARentCar(carid)
{
for(new i = 0; i < sizeof(RentCar); i++)
{
if(carid == RentCar[i]) return 1;
}
return 0;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
...
if(IsARentCar(newcar)) //rent koli
{
new string[256];
new coordsstring1[256];
new coordsstring2[256];
new coordsstring3[256];
new coordsstring4[256];
new textp;
new texto;
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(coordsstring1, sizeof(coordsstring1),"%s, if you want to rent this vehicle", sendername);
format(coordsstring2, sizeof(coordsstring2),"\n Press 'Accept,textp);
format(coordsstring3, sizeof(coordsstring3),"\n If you want to get out press Decline'",texto);
format(coordsstring4, sizeof(coordsstring4),"\n {F00000}Money: 20$/minute",texto);
format(string, 991," %s%s%s%s",coordsstring1,coordsstring2,coordsstring 3,coordsstring4);
ShowPlayerDialog(playerid, 991, DIALOG_STYLE_MSGBOX, "Rent Vehicle", string, "Accept", "Decline");
}

