Why doesnt this work?
#1

I'm working on a DM zone, and I want players to only have weapons when inside that zone.
This code doesnt give me any errors when compiled in my GM, but it doesn't seem to work in the server.

public isPlayerInArea()
{
new Float:X, Float:Y, Float:Z;
for(new i=0; i < MAX_PLAYERS; i++)
{
GetPlayerPos(i, X, Y, Z);
if (X <= 2806.4766 && X >= 2566.6860 && Y <= -2332.2461 && Y >= -2562.3301) // area 1
{
}
else
{
ResetPlayerWeapons(i);
}
}
}
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=222283
pawn Код:
IsPlayerInArea( playerid, Float:MinX, Float:MinY, Float:MaxX, Float:MaxY )
{
    new Float:X, Float:Y, Float:Z;
    GetPlayerPos( playerid, X, Y, Z );
    if(X >= 2806.4766 && X <= 2566.6860 && Y >= -2332.2461 && Y <= -2562.3301)
    {
    }
    else
    {
    ResetPlayerWeapons( playerid );
    }
    return 1;
    }
return 0;
}
Reply
#3

Gives me 2 errors:
error 010: invalid function or declaration
warning 203: symbol is never used: "IsPlayerInArea"
Reply
#4

PHP код:
stock IsPlayerInArea(playeridFloat:MinXFloat:MinYFloat:MaxXFloat:MaxY)
{
    new 
Float:XFloat:YFloat:Z;
    
GetPlayerPos(playeridXYZ);
    if(
>= MinX && <= MaxX && >= MinY && <= MaxY
    {
        return 
1;
    }
    return 
0;
}

public 
Check()
{
    new 
Float:XFloat:YFloat:Z;
    for(new 
i=0MAX_PLAYERSi++)
    {
        if(!
IsPlayerInArea(i2566.6860, -2562.33012806.4766, -2332.2461))
        {
            
ResetPlayerWeapons(i);
        }
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)