SA-MP Forums Archive
[HELP] help me please - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP] help me please (/showthread.php?tid=478341)



[HELP] help me please - warlord321 - 29.11.2013

okay i dont know where i must start..

if you login on server is fine, but if you meet another player that player is like on alt tab. but he is not in alt tab.. anyone help me please....




Re: [HELP] help me please - Konstantinos - 29.11.2013

Returning 0 in OnPlayerUpdate will not update the player to other clients. So make sure it returns 1.


Re: [HELP] help me please - warlord321 - 29.11.2013

Like this ?
pawn Код:
public OnPlayerUpdate(playerid)
{
    if(!IsPlayerConnected(playerid)) return 1;
    // No weapons in interiors
    if(GetPlayerInterior(playerid) != 0 && GetPlayerWeapon(playerid) != 0) {
        SetPlayerArmedWeapon(playerid,0); // fists
        return 0; // no syncing until they change their weapon
    }
    return 1;
}
Before
pawn Код:
public OnPlayerUpdate(playerid)
{
    if(!IsPlayerConnected(playerid)) return 0;
    // No weapons in interiors
    if(GetPlayerInterior(playerid) != 0 && GetPlayerWeapon(playerid) != 0) {
        SetPlayerArmedWeapon(playerid,0); // fists
        return 0; // no syncing until they change their weapon
    }
    return 1;
}



Re: [HELP] help me please - Ballu Miaa - 29.11.2013

Well i think changing that return 0; to return 1; will solve the problem. You should never return 0 under OnPlayerUpdate. Everytime a player selects a weapon it will set Fire Weapon to 0 again.

It can be like this.
pawn Код:
public OnPlayerUpdate(playerid)
{
    if(!IsPlayerConnected(playerid)) return 0;
    // No weapons in interiors
    if(GetPlayerInterior(playerid) != 0 && GetPlayerWeapon(playerid) != 0) {
        SetPlayerArmedWeapon(playerid,0); // fists
        return 1;
    }
    return 1;
}
Or

pawn Код:
public OnPlayerUpdate(playerid)
{
    if(!IsPlayerConnected(playerid)) return 0;
    // No weapons in interiors
    if(GetPlayerInterior(playerid) != 0 && GetPlayerWeapon(playerid) != 0) {
        SetPlayerArmedWeapon(playerid,0); // fists
    }
    return 1;
}



Re: [HELP] help me please - warlord321 - 29.11.2013

like this ?

pawn Код:
public OnPlayerUpdate(playerid)
{
    if(!IsPlayerConnected(playerid)) return 1;
    // No weapons in interiors
    if(GetPlayerInterior(playerid) != 0 && GetPlayerWeapon(playerid) != 0) {
        SetPlayerArmedWeapon(playerid,0); // fists
        return 1; // no syncing until they change their weapon
    }
    return 1; //this is disable or not ?
}



Re: [HELP] help me please - warlord321 - 29.11.2013

still same

am using this
pawn Код:
public OnPlayerUpdate(playerid)
{
    if(!IsPlayerConnected(playerid)) return 0;
    // No weapons in interiors
    if(GetPlayerInterior(playerid) != 0 && GetPlayerWeapon(playerid) != 0) {
        SetPlayerArmedWeapon(playerid,0); // fists
    }
    return 1;
}



Re: [HELP] help me please - Konstantinos - 29.11.2013

The problem was not from the code you posted, it may return 0 at the end of the callback or return nothing in some other mode (filterscript, include etc).


Re: [HELP] help me please - warlord321 - 29.11.2013

Okay problem solved.. thanks sir..