SA-MP Forums Archive
Need HELP with My stat script - 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: Need HELP with My stat script (/showthread.php?tid=73861)



Need HELP with My stat script - vovz - 18.04.2009

Hello can eyone tell me whats wrong?
This part work all time if player even have PlayerInfo[playerid][pStrenghtPoints] = 0; it set PlayerInfo[playerid][pStrenght] += 1;
______________
It should work like if player have 100 pStrenghtPoints it will set [pStrenght] += 1; and reset to 0 pStrenghtPoints

Код:
if (PlayerInfo[playerid][pStrenghtPoints] <= 100)
	  {
	  PlayerInfo[playerid][pStrenghtPoints] = 0;
	  PlayerInfo[playerid][pStrenght] += 1;
	  SendClientMessage(playerid, COLOR_GREEN,"Strenght upgraded");
	  }
	  else
		{
		SendClientMessage(playerid, COLOR_GRAD6, "Not enough for strenght.");
		return 1;
		}



Re: Need HELP with My stat script - Soeren - 18.04.2009

Easy thing, you just made a small mistake

pawn Код:
if (PlayerInfo[playerid][pStrenghtPoints] <= 100)
You check if the StrengthPoints are LESS here, you just switched the sign the false way around, just put it like

pawn Код:
if (PlayerInfo[playerid][pStrenghtPoints] >= 100)
and it should work :P


Re: Need HELP with My stat script - vovz - 19.04.2009

Thank you