new renttimer; #define RENTANJE 991 forward RentStop(); new RentCar[19]; forward IsARentCar(carid); forward RentPlati(playerid); if(dialogid == RENTANJE) { if(response) { renttimer = SetTimer("RentPlati", 60000, 1); SendClientMessage(playerid, COLOR_INFO, "INFO:{FFFFFF}You can ride now"); } else { RemovePlayerFromVehicle(playerid); } } public RentStop() { KillTimer(renttimer); } public OnPlayerExitVehicle(playerid) { RentStop(); 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"); } |
new renttimer[MAX_PLAYERS]; renttimer[playerid] = SetTimer("RentPlati", 60000, 1); public RentStop(playerid) { KillTimer(renttimer[playerid]); } public OnPlayerExitVehicle(playerid) { RentStop(playerid); return 1; }
Код:
new renttimer[MAX_PLAYERS]; renttimer[playerid] = SetTimer("RentPlati", 60000, 1); public RentStop(playerid) { KillTimer(renttimer[playerid]); } public OnPlayerExitVehicle(playerid) { RentStop(playerid); return 1; } |
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"); }
Make a SetTimerEx
SetTimerEx("RentPlati", 60000, 1, "i", playerid); |