09.11.2010, 12:59
How to find the x_MAX, x_MIN, y_MAX, y_MIN Coodinates?
Please in advanced!
Please in advanced!
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 |
#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;
}
#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;
}
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;
}
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 Код:
|
#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;
}
#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;
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.
#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;
}