SetPlayerSkillLevel - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: SetPlayerSkillLevel (
/showthread.php?tid=96657)
SetPlayerSkillLevel -
OFFREAL - 09.09.2009
Please add function
GetPlayerSkillLevel(playerid, skill, level)
Re: SetPlayerSkillLevel -
Donny_k - 09.09.2009
It's scriptable.
Re: SetPlayerSkillLevel -
niCe - 09.09.2009
It may be scriptable, but for anticheat, you will need a function for getting that current skill level.
Re: SetPlayerSkillLevel -
dugi - 09.09.2009
The Skill level is server side and not client side, therefore any cheats changing it wont have any effect.
Re: SetPlayerSkillLevel -
Jay_ - 09.09.2009
Quote:
Originally Posted by dugi
The Skill level is server side and not client side, therefore any cheats changing it wont have any effect.
|
Sorry (/me runs) but that's bs. Offcourse it has an effect client side, there are probably cheats available for it already. The server must probably just sends data which the client reads and updates accordingly. How do you think skill levels occured in singleplayer?
Re: SetPlayerSkillLevel -
G-Star99 - 10.09.2009
Quote:
Originally Posted by Seif_ [adream-rp.com
]
Quote:
Originally Posted by Jay_
Quote:
Originally Posted by dugi
The Skill level is server side and not client side, therefore any cheats changing it wont have any effect.
|
Sorry (/me runs) but that's bs. Offcourse it has an effect client side, there are probably cheats available for it already. The server must probably just sends data which the client reads and updates accordingly. How do you think skill levels occured in singleplayer?
|
That cheat most likely just changes it for the client and not for everyone in the server.
|
Is the skill level replicated to other clients?
Re: SetPlayerSkillLevel -
dugi - 10.09.2009
Quote:
Originally Posted by Jay_
Quote:
Originally Posted by dugi
The Skill level is server side and not client side, therefore any cheats changing it wont have any effect.
|
Sorry (/me runs) but that's bs. Offcourse it has an effect client side, there are probably cheats available for it already. The server must probably just sends data which the client reads and updates accordingly. How do you think skill levels occured in singleplayer?
|
It might have an effect only on the screen of the person who used a cheat to change the skill level, but it won't be replicated to other clients however.
Re: SetPlayerSkillLevel -
Donny_k - 10.09.2009
Quote:
Originally Posted by Jay_
Quote:
Originally Posted by dugi
The Skill level is server side and not client side, therefore any cheats changing it wont have any effect.
|
Sorry (/me runs) but that's bs. Offcourse it has an effect client side, there are probably cheats available for it already. The server must probably just sends data which the client reads and updates accordingly. How do you think skill levels occured in singleplayer?
|
Yes "client side" so the server and the rest of the players (not your client) will be running the old value. I don't know how this effects hit messages or whatever but it should get the hit message, get the weapon, get the skill, do the math of the impact force based on your weapon and skill and then broadcast it so client side modifications of whatever values won't matter.
Anyway some code incase anyone wants it (untested but should be fine):
pawn Код:
//global
new
gSkillLevel[ MAX_PLAYERS ][ 11 ];
//set (you could wrap this as a define)
gSkillLevel[ playerid ][ skillid ] = level;
SetPlayerSkillLevel( playerid, skillid, level );
//get
#define GetPlayerSkillLevel(%1,%2) gSkillLevel[ %1 ][ %2 ]
//or
GetPlayerSkillLevel( playerid, skillid ) //connection and index protection (OOB)
{
if ( IsPlayerConnected( playerid ) )
{
if ( skillid < 11 && skillid > -1 ) return gSkillLevel[ playerid ][ skillid ];
}
return 0;
}
pawn Код:
printf( "skill %d is %d", skillid, GetPlayerSkillLevel( playerid, skillid ) );
Just like money it's easy to track.