Wasted levels.. +1 rep - 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: Wasted levels.. +1 rep (
/showthread.php?tid=332108)
Wasted levels.. +1 rep -
jimis - 07.04.2012
Hi,how i can a player wasted level? and i can add hot keys. For example if a player is a shop and press "y" button then he will earn 200$ and he will take 2 wasted levels. If you help me i will give +1 rep
Thanks for reading
Re: Wasted levels.. +1 rep -
DBan - 07.04.2012
You mean wanted levels?
SA-MP Wiki is your friend
As for the buttons:
Simple search can bring miracles
Example:
pawn Code:
GivePlayerMoney(playerid, 200); //Gives the player 200$
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 2); //Gets the player's wanted level then adds to it
Button:
pawn Code:
//Definition is from SA-MP wiki
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (PRESSED(KEY_LOOK_BEHIND))
{
//your code here
}
return 1;
}
Well that's in my script, just edit it to your liking.
Re: Wasted levels.. +1 rep -
Harish - 07.04.2012
use if (newkeys == KEY_YES) only in 0.3d for the key y.do what the @DBan said above