Problem 100$ in OnPlayerDeath. - 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: Problem 100$ in OnPlayerDeath. (
/showthread.php?tid=563415)
Problem 100$ in OnPlayerDeath. -
Baltimore - 15.02.2015
Hello !
When a player death > The player loose 100$.
It's a "problem" in GTA.
I have an anticheat (call with OnPlayerUpdate), and it's a problem...
How to resolve this problem?
THX
Re: Problem 100$ in OnPlayerDeath. -
Dokins - 15.02.2015
You literally need to give them $100 on death, it's unavoidable, perhaps a SAMP update will fix this.
Add
pawn Код:
GivePlayerMoney(playerid, 100);
Under OnPlayerDeath.
Respuesta: Problem 100$ in OnPlayerDeath. -
zugg48 - 15.02.2015
Quote:
Originally Posted by Baltimore
Hello !
When a player death > The player loose 100$.
It's a "problem" in GTA.
I have an anticheat (call with OnPlayerUpdate), and it's a problem...
How to resolve this problem?
THX
|
Example:
Player Stats - Server Side
PlayerMoney[playerid]
Player Stats - Client Side
Money = 1000
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
UpdateMoney(playerid);
}
stock UpdateMoney(playerid)
{
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, PlayerMoney[playerid]);
}
Re: Problem 100$ in OnPlayerDeath. -
Baltimore - 15.02.2015
The anticheat banned before ..
Re: Problem 100$ in OnPlayerDeath. -
Dokins - 15.02.2015
Can I see the code where you use a money check for the anti cheat?
Re: Problem 100$ in OnPlayerDeath. -
Baltimore - 15.02.2015
My timer:
pawn Код:
forward Anticheat_money(playerid);
public Anticheat_money(playerid)
{
new string[144];
if(GetPlayerMoney(playerid) != PlayerInfo[playerid][Cash])
{
SendClientMessage(playerid, -1, "Cheat money detected.");
// Ban player.
SetTimerEx("Player_kick", 500, 0, "d", playerid);
return 1;
}
return 1;
}
Even from OnPlayerUpdate a timer in 1 second , it happens to be banned anyway ..
Re: Problem 100$ in OnPlayerDeath. -
Dokins - 15.02.2015
pawn Код:
forward Anticheat_money(playerid);
public Anticheat_money(playerid)
{
new string[144];
if(GetPlayerMoney(playerid) != PlayerInfo[playerid][Cash] && PlayerDead[playerid] == 0)
{
SendClientMessage(playerid, -1, "Cheat money detected.");
// Ban player.
SetTimerEx("Player_kick", 500, 0, "d", playerid);
return 1;
}
return 1;
}
Add PlayerDead[playerid] under OnPlayerDeath, That should make an exemption.