SA-MP Forums Archive
Simple problem -.- again - 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: Simple problem -.- again (/showthread.php?tid=179067)



Simple problem -.- again - nejc001 - 25.09.2010

How to add in this script line:
Код:
if (GetPlayerScore(playerid)<5) return SendClientMessage(playerid, 0xFF9900AA,"You must have higher score to buy this weapon.");
this script:
Код:
TogglePlayerControllable(playerid,1);
So if "if(GetPlayerScore(playerid)<5)" is not true "TogglePlayerControllable(playerid,1);" happens.
Same like "SendClientMessage" script.


Re: Simple problem -.- again - TouR - 25.09.2010

Cant see any TogglePlayerControllable :\


Re: Simple problem -.- again - [XST]O_x - 25.09.2010

You mean
pawn Код:
if(!(GetPlayerScore(playerid) < 5))
{
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, 0xFF9900AA,"You must have higher score to buy this weapon.");
}



Re: Simple problem -.- again - nejc001 - 25.09.2010

-.- yes ty


Re: Simple problem -.- again - nejc001 - 25.09.2010

-.- no i failed, now if you have less than 5 score you can buy it...
now my script looks lke this:
Код:
        if(!(GetPlayerScore(playerid) < 5))
{
  		 TogglePlayerControllable(playerid,1);
   		 SendClientMessage(playerid, 0xFF9900AA,"You must have higher score to buy this weapon.");
}
        if(GetPlayerMoney(playerid)<100)return SendClientMessage(playerid, 0xFF9900AA,"You dont have enough money.");
       		GivePlayerMoney(playerid,-100);
       		GivePlayerWeapon(playerid, 22, 100);
            SendClientMessage(playerid, 0xFFFF00AA, "You bought a Pistol 9mm.");
            TogglePlayerControllable(playerid,1);
        }



Re: Simple problem -.- again - TouR - 25.09.2010

if(GetPlayerScore(playerid) < 5)


Re: Simple problem -.- again - nejc001 - 25.09.2010

would work probaly... i fixed it in other way