If someone goes in a admin area (NoN-Admin), then he will get this text up "Get our or be killed in: (Count down from 15)"
And after 15 sec he get auto killed! (If he dident leave the area) How to make this? In advance please |
if(/* Playerinareafunction */)
{
if(/* IsplayeradminCode */)
{
/* your code here*/
}
}
else
{
SetPlayerHealth(playerid,0.0);
}
}
I did but i dont understan any thing, can you please make a full script of that, all i got is
pawn Код:
|
if(IsPlayerInRange(playerid, Rangeshithere)) // http://wiki.sa-mp.com and search for the function.
{
if(!IsPlayerAdmin(playerid)) // Is Player RCON ADMIN? kill if not..
{
SetPlayerHealth(playerid,0.0); // Kill the player..
}
}
new pKill[MAX_PLAYERS];
new pCount[MAX_PLAYERS];
if(IsPlayerInArea(playerid, x_MAX, x_MIN, y_MAX, y_MIN))
{
if(!IsPlayerAdmin(playerid))
{
pKill[playerid] = SetTimerEx("KillTime", 15000, false, "i", playerid);
}
return 1;
}
else if(!IsPlayerInArea(playerid, x_MAX, x_MIN, y_MAX, y_MIN))
{
KillTimer(pKill(playerid));
pCount[playerid] = 15;
return 1;
}
forward KillTime(playerid);
public KillTime(playerid)
{
pCount[playerid]--;
if(pCount > 15)
{
SetPlayerHealth(playerid, 0.0);
pCount[playerid] = 15;
}
}
new pKill[MAX_PLAYERS];
new pCount[MAX_PLAYERS];
if(IsPlayerInArea(playerid, 997, 917, 2046, 2182))
{
if(!IsPlayerAdmin(playerid))
{
pKill[playerid] = SetTimerEx("KillTime", 15000, false, "i", playerid);
}
return 1;
}
else if(!IsPlayerInArea(playerid, 997, 917, 2046, 2182))
{
KillTimer(pKill(playerid));
pCount[playerid] = 15;
return 1;
}
forward KillTime(playerid);
public KillTime(playerid)
{
pCount[playerid]--;
if(pCount > 15)
{
SetPlayerHealth(playerid, 0.0);
pCount[playerid] = 15;
}
}
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\KillInArea.pwn(1) : error 017: undefined symbol "MAX_PLAYERS"
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\KillInArea.pwn(2) : error 017: undefined symbol "MAX_PLAYERS"
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\KillInArea.pwn(2) : error 009: invalid array size (negative, zero or out of bounds)
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\KillInArea.pwn(4) : error 010: invalid function or declaration
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\KillInArea.pwn(6) : error 010: invalid function or declaration
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\KillInArea.pwn(10) : error 010: invalid function or declaration
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\KillInArea.pwn(12) : error 010: invalid function or declaration
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\KillInArea.pwn(14) : error 010: invalid function or declaration
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\KillInArea.pwn(14 -- 16) : error 010: invalid function or declaration
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\KillInArea.pwn(23) : error 033: array must be indexed (variable "pCount")
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\KillInArea.pwn(25) : error 017: undefined symbol "SetPlayerHealth"
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\KillInArea.pwn(29) : warning 203: symbol is never used: "KillTimer"
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\KillInArea.pwn(29) : warning 203: symbol is never used: "pKill"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
11 Errors.
Edited:
pawn Код:
It got 11 Error's pawn Код:
|
#include <a_samp>
new pKill[MAX_PLAYERS];
new pCount[MAX_PLAYERS];
if(IsPlayerInArea(playerid, 997, 917, 2046, 2182))
{
if(!IsPlayerAdmin(playerid))
{
pKill[playerid] = SetTimerEx("KillTime", 15000, false, "i", playerid);
}
return 1;
}
else if(!IsPlayerInArea(playerid, 997, 917, 2046, 2182))
{
KillTimer(pKill(playerid));
pCount[playerid] = 15;
return 1;
}
forward KillTime(playerid);
public KillTime(playerid)
{
pCount[playerid]--;
if(pCount > 15)
{
SetPlayerHealth(playerid, 0.0);
pCount[playerid] = 15;
}
}
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\KillInArea.pwn(6) : error 010: invalid function or declaration
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\KillInArea.pwn(8) : error 010: invalid function or declaration
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\KillInArea.pwn(12) : error 010: invalid function or declaration
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\KillInArea.pwn(14) : error 010: invalid function or declaration
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\KillInArea.pwn(18) : error 010: invalid function or declaration
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\KillInArea.pwn(25) : error 033: array must be indexed (variable "pCount")
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\KillInArea.pwn(31) : warning 203: symbol is never used: "pKill"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
6 Errors.
#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, 997, 917, 2046, 2182))
{
if(!IsPlayerAdmin(i))
{
pKill[i] = SetTimerEx("KillTime", 15000, false, "i", i);
}
}
else if(!IsPlayerInArea(i, 997, 917, 2046, 2182))
{
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;
}