Coordinates
#1

How to find the x_MAX, x_MIN, y_MAX, y_MIN Coodinates?

Please in advanced!
Reply
#2

Quote:
Originally Posted by Larsey123IsMe
Посмотреть сообщение
How to find the x_MAX, x_MIN, y_MAX, y_MIN Coodinates?

Please in advanced!
Why did you make yet another thread?

Look here: http://forum.sa-mp.com/showthread.ph...ehicle+plotter
Reply
#3

Quote:
Originally Posted by Cameltoe
Посмотреть сообщение
Why did you make yet another thread?

Look here: http://forum.sa-mp.com/showthread.ph...ehicle+plotter
Because noone answer on the other thread.

Your scrip failed, or i failed at coordinated, Please help me so we can stop this discussion:

pawn Код:
#include <a_samp>

new pKill[MAX_PLAYERS];
new pCount[MAX_PLAYERS];

public OnFilterScriptInit()
{
    SetTimer("Area_Check", 5000, true);
}

forward Area_Check();
public Area_Check()
{
    for(new i; i < MAX_PLAYERS +1; i++)
    {
        if(IsPlayerInArea(i, 892.6697, 2049.596, 978.5764, 2188.846)) //Edited
        {
            if(!IsPlayerAdmin(i))
            {
                pKill[i] = SetTimerEx("KillTime", 15000, false, "i", i);
            }
        }
        else if(!IsPlayerInArea(i, 892.6697, 2049.596, 978.5764, 2188.846)) //Edited
        {
            KillTimer(pKill[i]);
            pCount[i] = 15;
        }
    }
    return 1;
}

forward KillTime(playerid);
public KillTime(playerid)
{
    pCount[playerid]--;
    if(pCount[playerid] > 15)
    {
        SetPlayerHealth(playerid, 0.0);
        pCount[playerid] = 15;
    }
}

stock IsPlayerInArea(playerid, Float:minx, Float:maxx, Float:miny, Float:maxy)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if (x > minx && x < maxx && y > miny && y < maxy) return 1;
return 0;
}
Reply
#4

Please Help me!
Reply
#5

Can someone edit this scrip?:

pawn Код:
#include <a_samp>

new pKill[MAX_PLAYERS];
new pCount[MAX_PLAYERS];

public OnFilterScriptInit()
{
    SetTimer("Area_Check", 5000, true);
}

forward Area_Check();
public Area_Check()
{
    for(new i; i < MAX_PLAYERS +1; i++)
    {
        if(IsPlayerInArea(i, x_MAX, x_MIN, y_MAX, y_MIN))
        {
            if(!IsPlayerAdmin(i))
            {
                pKill[i] = SetTimerEx("KillTime", 15000, false, "i", i);
            }
        }
        else if(!IsPlayerInArea(i, x_MAX, x_MIN, y_MAX, y_MIN))
        {
            KillTimer(pKill[i]);
            pCount[i] = 15;
        }
    }
    return 1;
}

forward KillTime(playerid);
public KillTime(playerid)
{
    pCount[playerid]--;
    if(pCount[playerid] > 15)
    {
        SetPlayerHealth(playerid, 0.0);
        pCount[playerid] = 15;
    }
}

stock IsPlayerInArea(playerid, Float:minx, Float:maxx, Float:miny, Float:maxy)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if (x > minx && x < maxx && y > miny && y < maxy) return 1;
return 0;
}
To when ill walk in the LV - Mat factory area, then the countdow to kill start...

LV - Meat Factory:
Reply
#6

OMG DONT NAG! :P
No serious, you can wait.. Just bump after 12 hours or something, not 10 minutes! (so to speak)
But the code of vehicleplotter is this: MinX, MinY, MaxX, MaxY, I had the same problem first too xD
Here's a "edit" of the InArea:

pawn Код:
stock IsPlayerInArea(playerid, minx, miny, maxx, maxy)
{
    new Float:pX, Float:pY, Float:pZ;
    GetPlayerPos(playerid, pX, pY, pZ);
    if(pX >= minx && pX <= maxx && pY >= miny && pY <= maxy)
        return true;
    else
        return false;
}
I think this is gonna work, I didnt test it
Reply
#7

Quote:
Originally Posted by Kwarde
Посмотреть сообщение
OMG DONT NAG! :P
No serious, you can wait.. Just bump after 12 hours or something, not 10 minutes! (so to speak)
But the code of vehicleplotter is this: MinX, MinY, MaxX, MaxY, I had the same problem first too xD
Here's a "edit" of the InArea:

pawn Код:
stock IsPlayerInArea(playerid, minx, miny, maxx, maxy)
{
    new Float:pX, Float:pY, Float:pZ;
    GetPlayerPos(playerid, pX, pY, pZ);
    if(pX >= minx && pX <= maxx && pY >= miny && pY <= maxy)
        return true;
    else
        return false;
}
I think this is gonna work, I didnt test it
Sorry for nagging, i am just desperate to get this to work.

But i still dont get it!, can you please edit the whole scrip so it works?

Works = When enter the Meet Factory then the count down frim 15 sec should start, after 15 sec in area he should get autokilled, Thank You!
Reply
#8

You are not nagging, if "beginners" in scripting (new people) need help, I'll just try to help them

pawn Код:
#include <a_samp>

new pKill[MAX_PLAYERS];
new pCount[MAX_PLAYERS];

public OnFilterScriptInit()
{
    SetTimer("Area_Check", 5000, true);
}

forward Area_Check();
public Area_Check()
{
    for(new i; i < MAX_PLAYERS +1; i++)
    {
        if(IsPlayerInArea(i, 892.6697, 2049.596, 978.5764, 2188.846))
        {
            if(!IsPlayerAdmin(i))
            {
                pKill[i] = SetTimerEx("KillTime", 15000, false, "i", i);
            }
        }
        else if(!IsPlayerInArea(i, 892.6697, 2049.596, 978.5764, 2188.846))
        {
            KillTimer(pKill[i]);
            pCount[i] = 15;
        }
    }
    return 1;
}

forward KillTime(playerid);
public KillTime(playerid)
{
    pCount[playerid]--;
    if(pCount[playerid] > 15)
    {
        SetPlayerHealth(playerid, 0.0);
        pCount[playerid] = 15;
    }
}

stock IsPlayerInArea(playerid, minx, miny, maxx, maxy)
{
    new Float:pX, Float:pY, Float:pZ;
    GetPlayerPos(playerid, pX, pY, pZ);
    if(pX >= minx && pX <= maxx && pY >= miny && pY <= maxy)
        return true;
    else
        return false;
}
Try this script - idk if it's working. I guess it's working.
If you made the co-ordinations with xTreme vehicleplotter, this'll will probaly work

[EDIT]
p.s., about the "anti-cheat" you probaly made (xD, I don't wanna be unarmed with that script)
You can better use "OnPlayerUpdate", so you don't need to use times. Here's a example :P

pawn Код:
#include <a_samp>

public OnPlayerUpdate(playerid)
{
    new pTmpName[MAX_PLAYER_NAME], string[128];
    GetPlayerName(playerid, pTmpName, MAX_PLAYER_NAME);
    if(GetPlayerWeapon(playerid) == 0){
        format(string, 128, "%s has been banned by the console - He was unarmed!", pTmpName);
        SendClientMessageToAll(0xFF0000AA, string);
        BanEx(playerid, "AntiCheat - Unarmed!");
    }
    return 1;
xD
Reply
#9

i get Errors

pawn Код:
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\KillInArea.pwn(16) : warning 213: tag mismatch
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\KillInArea.pwn(16) : warning 213: tag mismatch
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\KillInArea.pwn(16) : warning 213: tag mismatch
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\KillInArea.pwn(16) : warning 213: tag mismatch
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\KillInArea.pwn(23) : warning 213: tag mismatch
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\KillInArea.pwn(23) : warning 213: tag mismatch
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\KillInArea.pwn(23) : warning 213: tag mismatch
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\KillInArea.pwn(23) : warning 213: tag mismatch
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


8 Warnings.
Reply
#10

I know the problem.
I had: "stock IsPlayerInArea(playerid, minx, miny);" etc..
But it had to be: Float:minx, Float:minxy etc...
ps, I am making a "better" script (same way, just different)
Please wait...

[EDIT]
DONE!
Try this script

pawn Код:
#include <a_samp>

new pTimer_Check[MAX_PLAYERS];
new pSecondsInArea[MAX_PLAYERS];

forward CheckPInArea(playerid);

public OnFilterScriptInit()
{
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

public OnPlayerSpawn(playerid)
{
    pTimer_Check[playerid] = SetTimerEx("CheckPInArea", 1000, true, "i", playerid);
    pSecondsInArea[playerid] = 0;
    return 1;
}

public OnPlayerDeath(playerid)
{
    KillTimer(pTimer_Check[playerid]);
    pSecondsInArea[playerid] = 0;
    return 1;
}

public CheckPInArea(playerid)
{
    if(IsPlayerInArea(playerid, 892.6697, 2049.596, 978.5764, 2188.846)){
        pSecondsInArea[playerid]++;
        if(pSecondsInArea[playerid] >= 15)
            SetPlayerHealth(playerid, 0);
    }
    else if(!IsPlayerInArea(playerid, 892.6697, 2049.596, 978.5764, 2188.846)){
        pSecondsInArea[playerid] = 0;
    }
    return 1;
}

stock IsPlayerInArea(playerid, Float:MinX, Float:MinY, Float:MaxX, Float:MaxY)
{
    new Float:pX, Float:pY, Float:pZ;
    GetPlayerPos(playerid, pX, pY, pZ);
    if(pX >= MinX && pX <= MaxX && pY <= MinY && pY >= MaxY)
        return true;
    else
        return false;
 }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)