18.12.2010, 18:04
Hi all,i've this code in OnPlayerStateChange
The code working fine,i just have errors with the Messages.
Example: I dont have the requested $,i enter in a Hydra (example vehicle) and i get the normal message:
And:
Same with others vehicles,what's the error?
Код:
if (newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT) { new veh = GetVehicleModel(GetPlayerVehicleID(playerid)); if(veh == 520) { new m = GetPlayerMoney(playerid), cost = 20000; SendClientMessage(playerid, 0xFFFFFF, "You need 20.000$ to enter in the Hydra."); if (m < cost) RemovePlayerFromVehicle(playerid); else if(m > cost) GivePlayerMoney(playerid,-cost); SendClientMessage(playerid, 0xFFFFFF, "Enjoy your Hydra."); } if(veh == 425) { new m = GetPlayerMoney(playerid), cost = 35000; SendClientMessage(playerid, 0xFFFFFF, "You need 35.000$ to enter in the Hunter."); if (m < cost) RemovePlayerFromVehicle(playerid); else if(m > cost) GivePlayerMoney(playerid,-cost); SendClientMessage(playerid, 0xFFFFFF, "Enjoy your Hunter,remember to rape all!"); } if(veh == 432) { new m = GetPlayerMoney(playerid), cost = 15000; SendClientMessage(playerid, 0xFFFFFF, "You need 15.000$ to enter in the Rhino."); if (m < cost) RemovePlayerFromVehicle(playerid); else if(m > cost) GivePlayerMoney(playerid,-cost); SendClientMessage(playerid, 0xFFFFFF, "Enjoy your Rhino."); } return 1; }
Example: I dont have the requested $,i enter in a Hydra (example vehicle) and i get the normal message:
Код:
SendClientMessage(playerid, 0xFFFFFF, "You need 20.000$ to enter in the Hydra.");
Код:
SendClientMessage(playerid, 0xFFFFFF, "Enjoy your Hydra.");