13.10.2012, 14:11
Hello
I have a problem.
I maked rent bikes and when someone gets in the bike it shows and dialog if you want to accept and decline if you accept you can ride and in every 2 minutes you pay 20$ and when you get out it must kill the timer but it kills it not
When you get out the timer is not killed it is spamming in every 2 minutes you payed 20$ .. and you must relog
It's working fine only for ID 0
here is my command
Hope you will help me
I have a problem.
I maked rent bikes and when someone gets in the bike it shows and dialog if you want to accept and decline if you accept you can ride and in every 2 minutes you pay 20$ and when you get out it must kill the timer but it kills it not
When you get out the timer is not killed it is spamming in every 2 minutes you payed 20$ .. and you must relog
It's working fine only for ID 0
here is my command
Quote:
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"); } |