07.09.2012, 16:15
Quote:
|
The first callback hook could be the issue - look at the difference between how it and the other one call CallLocalFunction. The second one returns 1 by default, the first doesn't so returns 0 instead.
|
Now I did this.
Код:
public OnPlayerUpdate( playerid )
{
if( GetPlayerMoney( playerid ) != GetPVarInt( playerid, "sMoney" ) )
{
ResetPlayerMoney( playerid );
GivePlayerMoney( playerid, GetPVarInt( playerid, "sMoney" ) );
}
CallLocalFunction( "samc_OnPlayerUpdate", "i", playerid );
return 1;
}
Код:
public OnPlayerUpdate(playerid) {
new
iVehicle = GetPlayerVehicleID(playerid)
;
if(GetPlayerVehicleSeat(playerid) != 0) {
if(GetPVarInt(playerid, "#ultimoveiculo") != iVehicle) {
SetPVarInt(playerid, "#ultimoveiculo", iVehicle);
if(GetVehicleModel(iVehicle)) {
@ChangeVehicles(playerid, PLAYER_STATE_DRIVER, iVehicle);
}
}
}
if(funcidx("flood_controlOnPlayerUpdate") != -1) {
return CallLocalFunction("flood_controlOnPlayerUpdate", "i", playerid);
}
return true;
}
Quote:
|
Theyre both the same. True == 1. Only with booleans you can ONLY use true/false, and not 1/0. There is an important distinction no-one else has mentioned. "true" and "false" have a tag of "bool:" which give the compiler hints about where they can be used. 0 and 1 don't (they have the default tag, which is "_:"). |


