kā uztaisīt Autokill?
Posted: 22 Jan 2010, 13:05
Kā uztaisīt autokill bāzei,lai nomirtu tie,kas ienāk bāzē,tikai ne bāzes īpašnieks(i)
Code: Select all
new ClanZone;
forward AdminArea(playerid);
forward DoesPlayerHasTag(playerid,tag[]);
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Clan Area by Snipe");
print("--------------------------------------\n");
ClanZone = GangZoneCreate(-768.4227,822.0857,-583.2678,989.1851); // Put here your Clan Zone Coords
SetTimer("AdminArea", 1000, 1);
SetTimer("DoesPlayerHasTag", 500, 1);
return 1;
}
public OnPlayerConnect(playerid)
{
GangZoneShowForAll(ClanZone,COLOR_RED);// Replace Red with the color you want,Remember you can only use one of the colors defined
//------------------------------------------------------------------------------
public AdminArea(playerid)
{
new i, Float:X, Float:Y, Float:Z;
for (i = 0; i = -768.4227 && X = 822.0857 && Y = 0.0000 && Z <= 30.0000) //REPLACE XMIN,XMAX,YMIN,YMAX,ZMIN,ZMAX by your coordinates
{
if(!DoesPlayerHasTag(playerid,"[XTC]")) //Replace This by Your Clan Tag
{
SetPlayerHealth(playerid,0);
}
}
}
}
//------------------------------------------------------------------------------
public DoesPlayerHasTag(playerid,tag[]) {
new name[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,sizeof(name));
return (strfind(name,tag,true) != -1) ? 1 : 0;
}
//------------------------------------------------------------------------------if(!DoesPlayerHasTag(playerid,"[XTC]")) //Replace This by Your Clan Tag
{
Code: Select all
if(!DoesPlayerHasTag(playerid,"[XTC]"))
if(!DoesPlayerHasTag(playerid,"[XTC1]"))Code: Select all
if(!(DoesPlayerHasTag(playerid,"[XTC]") || DoesPlayerHasTag(playerid,"[XTC2]")))