Recent Posts
1
Off-Topic General / Re: php signature
« Yesterday at 11:43 PM by Namir »
Bro you are 'developer' of web-net and you can't fix that simple code? smallmind ;D ;D ;D ;D ;D
2
Snippet Showroom / Re: /flip Command for cars.
« Yesterday at 10:11 PM by rww »
Quote from Rest on July 12th, 01:51 AM
Quote from rww on June 9th, 03:24 PM
With this, only driver can flip the car ;)
How about :)
Code: [Select]
if  ( player.VehicleSlot == 0 ) MessagePlayer( "[#ff1111]Error: [#ffffff]You must be a driver." , player );
Layter I check it ;)
3
Quote from Athanatos Yesterday at 07:42 PM
Alrighty then, are you sure InPoly works with strings?
Quote from Xmair Yesterday at 08:20 PM
That function expects floats, not strings.
In the Wiki it puts the opposite.(I didn't try with floats.)
4
That function expects floats, not strings.
5
Alrighty then, are you sure InPoly works with strings?
6
Quote from Athanatos Yesterday at 06:18 PM
Use DistanceFromPoint() instead.
This function doesn't allow me to make geometric shapes like a rectangle / square. Also, the previous function should work.
7
Use DistanceFromPoint() instead.
8
Hi everyone, I am writing a function for detect bank locations and ATMs. In this moment, I have got this:

main.nut
Code: [Select]
// BANK LOCATIONS
banks <- [
"-921.229, -355.514, -928.713, -326.602, -901.457, -326.602, -901.457, -355.519", // elBancoCorruptoGrande
"357.028, 1127.34, 356.961, 1132.15, 359.17, 1132.33, 359.462, 1127.27", // atmMall
"6.47041, -949.763, 1.30694, -949.764, 1.51372, -947.378, 6.33632, -947.53", // atmWashingtonMallRightSide
"1.44156, -928.274, 6.39117, -928.274, 6.37502, -930.697, 1.46436, -930.314" // atmWashingtonMallLeftSide
]

another_one.nut
Code: [Select]
function isPlayerIntoBank(player) {
    local found = false;

    for(local i = 0; i < banks.len() && !found; i++) {
        if(InPoly(player.Pos.x, player.Pos.y, banks[i]))
            found = true;
    }

    return found;
}



In the wiki say that the arguments are two floats (player.Pos) and an string / array / floats, but fails.
9
This is an example script. The server remembers the stats for 2 minutes after leaving the server. After 2 mins, score will be reset to value 0.

Code: [Select]
function onScriptLoad()
{
RememberPlrStats <- {};
PlayersScore <- {};
NewTimer("refresh",5000,0);
return 1;
}

function onPlayerJoin(player)
{
if (PlayersScore.rawin(p.UniqueID)) KillsA[p.ID] = PlayersScore.rawget(p.UniqueID);
if (PlayersScore.rawin(p.UniqueID)) PlayersScore.rawdelete(p.UniqueID);
if (RememberPlrStats.rawin(p.UniqueID)) RememberPlrStats.rawdelete(p.UniqueID);
return 1;
}

function onPlayerPart(player,reason)
{
RememberPlrStats.rawset(player.UniqueID,GetTickCount())
PlayersScore.rawset(player.UniqueID,player.Score);
return 1;
}

function onPlayerKill(killer,player,reason,body)
{
killer.Score ++;
return 1;
}

function refresh()
{
foreach (uid, tick in RememberPlrStats)
{
local count = GetTickCount() - tick;
print(count);
if (count > 120000) //in ms (here it's 2min)
{
if (PlayersScore.rawin(uid)) PlayersScore.rawdelete(uid);
if (RememberPlrStats.rawin(uid)) RememberPlrStats.rawdelete(uid);
}
}
}
10
Support / Re: Script Help
« Yesterday at 05:38 PM by Mahmut_Tuncer »
Okay I Fixed