24.10.2010, 17:32
new statussultan;
It is necessary that when the car Spawn became on ' 0 ' that it was possible to buy once again
Here is how has made:
When the car Spawn doesn't become on '0'
Код:
if (strcmp("/buycar1", cmdtext, true) == 0) **{ ********if(statussultan == 0) ********{ ********SendClientMessage(playerid, 0xFF0000FF, "You have bought sultan"); ********statussultan = 1; ********} ********return 1; *******}
Код:
public OnPlayerStateChange(playerid, newstate, oldstate) { *****if(newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT) *****{ *********new buyvehicl = GetPlayerVehicleID(playerid); *********if(buyvehicl == buycar) *********{ *********if(statussultan == 0) *********{ *********RemovePlayerFromVehicle(playerid); *********SendClientMessage(playerid, 0xB50F00AA, "At first will buy the car"); *********statussultan = 0; *********} *********} ***else if(statussultan == 1) *********{ ***statussultan = 1; *********} *********}
Here is how has made:
Код:
public OnVehicleSpawn(vehicleid) { *****statussultan = 0; *****return 1; }