SA-MP Forums Archive
2 questions ?? - 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: 2 questions ?? (/showthread.php?tid=130159)



2 questions ?? - $$ Matej8700 $$ - 25.02.2010

Hi guys i have two things that i dont know how to script it
1.i know which line is for gray colour 0xAAAAAAAA how which
line is for light green colour and red colour
2.how i make when somebody has -10,000$ he goes to jail

ok that is all
thanks


Re: 2 questions ?? - Torran - 25.02.2010

1. http://www.gtagarage.com/mods/show.php?id=2598 ( SAMP Color Picker )
2. if(GetPlayerMoney(playerid) == -10000)

On 2. Im not so sure, Try it though


Re: 2 questions ?? - VonLeeuwen - 25.02.2010

1. http://www.2createawebsite.com/build/hex-colors.html, you can pick them there. Just remove the '#', and add 0x in front, and AA (or 00 - 99) at the back.


Re: 2 questions ?? - Torran - 25.02.2010

Quote:
Originally Posted by VonLeeuwen
1. http://www.2createawebsite.com/build/hex-colors.html, you can pick them there. Just remove the '#', and add 0x in front, and AA (or 00 - 99) at the back.
http://www.gtagarage.com/mods/show.php?id=2598
Is better as you dont have to remove the # and whatever,
Its made especially for SAMP


Re: 2 questions ?? - VonLeeuwen - 25.02.2010

And it has all colors?


Re: 2 questions ?? - LuxurioN™ - 25.02.2010

Question 1:

I recommend to you use any software to generate colours code. Type "colour picker" in search.

Question 2:

First you must create a timer to always check if the player has the money:
In Top of your GameMode/Fs:
pawn Код:
CheckMoney();
In OnGameModeInit/OnFilterScriptInit
pawn Код:
SetTimer("CheckMoney",1000,1); //1 second
Second, you must create a function to verify player money:
(Put in any anywhere):
pawn Код:
public CheckMoney()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && GetPlayerMoney(i) == -10000)
{
//JAIL FUNCTION HERE
}
}
return 1;
}



Re: 2 questions ?? - dice7 - 25.02.2010

pawn Код:
public OnGameModeInit()
{
    SetTimer("MoneyCheck", 1000, 1);
    return 0;
}

forward MoneyCheck();
public MoneyCheck()
{
    new
        id = 0,
        max = GetMaxPlayers();
    for(; id < max; id++)
    {
        if(GetPlayerMoney(id) <= -10000)
        {
            //jail player
        }
    }
}