Players not moving on my Screen
#2

Quote:
Originally Posted by ******
Посмотреть сообщение
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.
Thanks ******. I though the returning of the first one was default by 1. So I didn't try to change that.

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;
}
And as you can see I have added another Onplayerupdate. Is return true; Correct? or should I change it to 1 instead?

Код:
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;
}
EDIT: I got it now
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 "_:").

Reply


Messages In This Thread
Players not moving on my Screen - by kbalor - 07.09.2012, 15:53
Re: Players not moving on my Screen - by kbalor - 07.09.2012, 16:15
Re: Players not moving on my Screen - by kbalor - 07.09.2012, 17:10

Forum Jump:


Users browsing this thread: 1 Guest(s)