SA-MP Forums Archive
how to stop the sa-mp server from syncing weapons and onfoot sync (rates) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP (https://sampforum.blast.hk/forumdisplay.php?fid=3)
+--- Forum: General (https://sampforum.blast.hk/forumdisplay.php?fid=13)
+--- Thread: how to stop the sa-mp server from syncing weapons and onfoot sync (rates) (/showthread.php?tid=305062)



how to stop the sa-mp server from syncing weapons and onfoot sync (rates) - Kar - 21.12.2011

IDK, if the topic says it right.

But how can I disable weapon and onfoot syncing? to make the server only sync vehicles..

like change weapon_rate to -1 in server.cfg or something? (what will -1 do?)

if I stop weapon and onfoot syncing,(removing bandwidth usage) and increase vehicle rate, will it be much smoother?


Re: how to stop the sa-mp server from syncing weapons and onfoot sync (rates) - T0pAz - 21.12.2011

Weapon_rate is the minimum time in milliseconds a client updates the server data of it. The answer of your question depends on your Server Host.


Re: how to stop the sa-mp server from syncing weapons and onfoot sync (rates) - Kar - 21.12.2011

yes I know.. I don't want the client / server to update it <.<... isn't that just wasting resources if you COMPLETELY don't need/use weapons?


Re: how to stop the sa-mp server from syncing weapons and onfoot sync (rates) - XFlawless - 21.12.2011

Quote:
Originally Posted by Kar
Посмотреть сообщение
yes I know.. I don't want the client / server to update it <.<... isn't that just wasting resources if you COMPLETELY don't need/use weapons?
Could desync some packets ?


Re: how to stop the sa-mp server from syncing weapons and onfoot sync (rates) - Sergei - 21.12.2011

Try to set sync time to 99999999999 or something? :P


Re: how to stop the sa-mp server from syncing weapons and onfoot sync (rates) - Emmet_ - 21.12.2011

Try this maybe?

pawn Код:
public OnPlayerUpdate(playerid)
{
    if(GetPlayerWeapon(playerid))
    {
        SetPlayerArmedWeapon(playerid, 0);
        return 0;
    }
    if(!IsPlayerInAnyVehicle(playerid))
    {
        return 0;
    }
    return 1;
}
Fact: Returning zero under OnPlayerUpdate will halt the sync, if the 'if' expression above is true.


Re: how to stop the sa-mp server from syncing weapons and onfoot sync (rates) - MP2 - 21.12.2011

I think he's saying that he doesn't ever give players weapons, so wants to disable sync for them.


Re: how to stop the sa-mp server from syncing weapons and onfoot sync (rates) - Hiddos - 21.12.2011

Quote:
Originally Posted by MP2
Посмотреть сообщение
I think he's saying that he doesn't ever give players weapons, so wants to disable sync for them.
If that is so, it'd be totally useless. No weapons mean that weapon data never needs to get synchronized.

You could try setting it do 0, then test it with a friend.


Re: how to stop the sa-mp server from syncing weapons and onfoot sync (rates) - [MM]IKKE - 21.12.2011

Quote:
Originally Posted by Emmet_
Посмотреть сообщение
Try this maybe?

pawn Код:
public OnPlayerUpdate(playerid)
{
    if(GetPlayerWeapon(playerid))
    {
        SetPlayerArmedWeapon(playerid, 0);
        return 0;
    }
    if(!IsPlayerInAnyVehicle(playerid))
    {
        return 0;
    }
    return 1;
}
Fact: Returning zero under OnPlayerUpdate will halt the sync, if the 'if' expression above is true.
I don't know anything about PAWN, but I have knowledge of other scripting languages. I've got a question on your script, and that question is also on-topic for the thread itself:

If you stop syncing when the player isn't in a vehicle (I assume "if(!IsPlayerInAnyVehicle(playerid))" does that), then how will the server know the player entered a vehicle again? It stopped sync'ing...

Correct me if I'm wrong...or just give out a general facepalm


Re: how to stop the sa-mp server from syncing weapons and onfoot sync (rates) - Kar - 22.12.2011

Yea, using OnPlayerUpdate is not a good idea, because the player will never get weapons or be out of the vehicle right... (unless they hack)

so basically instead of making a anti-cheat for that, and wasting the server resources, why not just.. stop the sync?

And setting it to a large number like 99999999, wouldn't that mean the server will have to count each ms still? just wondering.. it's not a problem but I'll do it.

I'll try 0 also