Hallo,
ich habe mich in den letzten paar stunden versucht, ein eigenes GangFight Script zu erstellen (für Godfather)
Dabei ist das hier momentan als FilterScript rausgekommen (ich mache später noch eingie CMD's für die Fraktionsleader rein ;))
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#include <dini>
new GangZone[1];
#define blau 0x0085C4F6
#define NB 0x005B9BF6 // Neues Blau
#define NY 0xF5DEB3AA // Neues Gelb
#define RED_NEW 0xF60000F6
#define BLUE_NEW 0x0000CAF6
#define GREEN 0x21DD00FF
#define ORANGE 0xF97804FF
#define RED 0xE60000FF
#define MAX_STRING 255
#define CHECKPOINT_NONE 0
#define CHECKPOINT_HOME 12
#define COLOR_GOLD 0xB8860BAA
#define COLOR_GRAD1 0xB4B5B7FF
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_GRAD3 0xCBCCCEFF
#define COLOR_GRAD4 0xD8D8D8FF
#define COLOR_GRAD5 0xE3E3E3FF
#define COLOR_GRAD6 0xF0F0F0FF
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_BROWN 0x330000FF
#define COLOR_BLACK 0x000000FF
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_LIGHTRED 0xFF6347AA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_LIGHTGREEN 0x9ACD32AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_YELLOW2 0xF5DEB3AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_FADE1 0xE6E6E6E6
#define COLOR_FADE2 0xC8C8C8C8
#define COLOR_FADE3 0xAAAAAAAA
#define COLOR_FADE4 0x8C8C8C8C
#define COLOR_FADE5 0x6E6E6E6E
#define COLOR_PURPLE 0xC2A2DAAA
#define COLOR_DBLUE 0x2641FEAA
#define COLOR_ALLDEPT 0xFF8282AA
#define COLOR_NEWS 0xFFA500AA
#define COLOR_OOC 0xE0FFFFAA
#define TEAM_CYAN 1
#define TEAM_BLUE 2
#define TEAM_GREEN 3
#define TEAM_ORANGE 4
#define TEAM_COR 5
#define TEAM_BAR 6
#define TEAM_TAT 7
#define TEAM_CUN 8
#define TEAM_STR 9
#define TEAM_HIT 10
#define TEAM_ADMIN 17
#define OBJECTIVE_COLOR 0x64000064
#define TEAM_GREEN_COLOR 0xFFFFFFAA
#define TEAM_JOB_COLOR 0xFFB6C1AA
#define TEAM_HIT_COLOR 0xFFFFFF00
#define TEAM_BLUE_COLOR 0x8D8DFF00
#define COLOR_ADD 0x63FF60AA
#define TEAM_GROVE_COLOR 0x00D900C8
#define TEAM_VAGOS_COLOR 0xFFC801C8
#define TEAM_BALLAS_COLOR 0xD900D3C8
#define TEAM_AZTECAS_COLOR 0x01FCFFC8
#define TEAM_CYAN_COLOR 0xFF8282AA
#define TEAM_ORANGE_COLOR 0xFF830000
#define TEAM_COR_COLOR 0x39393900
#define TEAM_BAR_COLOR 0x00D90000
#define TEAM_TAT_COLOR 0xBDCB9200
#define TEAM_CUN_COLOR 0xD900D300
#define TEAM_STR_COLOR 0x01FCFF00
#define TEAM_ADMIN_COLOR 0x00808000
#define COLOR_INVIS 0xAFAFAF00
#define COLOR_SPEC 0xBFC0C200
public OnFilterScriptInit()
{
if(dini_Exists("/folder/file.ini"))
{
// Wenn datei vorhanden ist
}
else
{
dini_Create("/folder/file.ini");
// Wenn datei nicht vorhanden ist
}
print("\n----------------------------------------");
print(" GangFight Script by Manuel Spielberger ");
print(" * * * * * Spielie * * * * * * ");
print("-----------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
SaveBase();
print("\nUnloaded");
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new string[256];
new cmd[256];
new tmp[256];
if(strcmp("/base1", cmdtext, true, 10) == 0)
{
if(IsPlayerAdmin(playerid))
{
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid, x,y,z);
dini_IntSet("/folder/file.ini", "bOwner", 6);
dini_FloatSet("/folder/file.ini", "MinX", x);
dini_FloatSet("/folder/file.ini", "MinY", y);
dini_FloatSet("/folder/file.ini", "MaxX", x+100);
dini_FloatSet("/folder/file.ini", "MaxY", y+100);
dini_BoolSet("/folder/file.ini", "angriff", false);
dini_IntSet("/folder/file.ini", "angriffbase", 0);
SendClientMessage(playerid, 0xFFFFFFFF, "GangZone wurde erstellt!");
return 1;
}
}
if(strcmp(cmd,"/bowner",true)==0)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerAdmin(playerid))
{
new idx;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "NUTZUNG: /bowner [value]");
return 1;
}
new Float: bID;
floatstr(tmp);
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid, x,y,z);
dini_IntSet("/folder/file.ini", "bOwner",bID);
dini_FloatSet("/folder/file.ini", "MinX", x);
dini_FloatSet("/folder/file.ini", "MinY", y);
dini_FloatSet("/folder/file.ini", "MaxX", x+100);
dini_FloatSet("/folder/file.ini", "MaxY", y+100);
dini_BoolSet("/folder/file.ini", "angriff", false);
dini_IntSet("/folder/file.ini", "angriffbase", 0);
format(string, sizeof(string), "* BaseBesitzer der Base Nr. 1 in %f geändert.",bID);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
}
}
if(strcmp(cmd,"/startware",true)==0)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerAdmin(playerid))
{
new idx;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "NUTZUNG: /startware [angreifende Gang]");
}
new Float: aID;
floatstr(tmp);
dini_IntSet("/folder/file.ini", "angriffbase", aID);
dini_BoolSet("/folder/file.ini", "angriff", true);
format(string, sizeof(string), "* Du hast einen Gangfight um das GangFightGebiet I mit der Fraktionsnummer %f gestartet.",aID);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
}
}
return 0;
}
public OnPlayerUpdate(playerid)
{
new Float:X, Float:Y, Float:X2, Flaot:Y2, bOwner, angriffb;
bOwner = dini_Int("/folder/file.ini", "bOwner");
X = dini_Float("/folder/file.ini", "MinX");
Y = dini_Float("/folder/file.ini", "MinY");
X2 = dini_Float("/folder/file.ini", "MaxX");
Y2 = dini_Float("/folder/file.ini", "MaxY");
angriffb = dini_Float("/folder/file.ini", "angriffbase");
GangZone[0] = GangZoneCreate(X, Y, X2, Y2);
new OWNER_COLOR;
if(bOwner == 5)
{
OWNER_COLOR = GangZoneShowForPlayer(playerid,GangZone[0],0x00000067);
}
else if(bOwner == 6)
{
OWNER_COLOR = GangZoneShowForPlayer(playerid,GangZone[0],0xFFFFFF67);
}
else if(bOwner == 12)
{
OWNER_COLOR = GangZoneShowForPlayer(playerid,GangZone[0],0x00890067);
}
else if(bOwner == 13)
{
OWNER_COLOR = GangZoneShowForPlayer(playerid,GangZone[0],0xFF00FF67);
}
else if(bOwner == 14)
{
OWNER_COLOR = GangZoneShowForPlayer(playerid,GangZone[0],0xFFFF0067);
}
else if(bOwner == 15)
{
OWNER_COLOR = GangZoneShowForPlayer(playerid,GangZone[0],0x00FFFF67);
}
else if(bOwner == 1)
{
OWNER_COLOR = GangZoneShowForAll(GangZone[0],COLOR_GOLD);
}
else
{
OWNER_COLOR = GangZoneShowForAll(GangZone[0],0x000000FF);
}
new bool:attack = dini_Bool("/folder/file.ini", "angriff");
if(attack == true)
{
new ANGRIFF_COLOR;
if(angriffb == 5)
{
ANGRIFF_COLOR = 0x00000067;
GangZoneFlashForAll(GangZone[0],ANGRIFF_COLOR);
}
if(angriffb == 6)
{
ANGRIFF_COLOR = 0xFFFFFF67;
GangZoneFlashForAll(GangZone[0],ANGRIFF_COLOR);
}
if(angriffb == 12)
{
ANGRIFF_COLOR = 0x00890067;
GangZoneFlashForAll(GangZone[0],ANGRIFF_COLOR);
}
if(angriffb == 13)
{
ANGRIFF_COLOR = 0xFF00FF67;
GangZoneFlashForAll(GangZone[0],ANGRIFF_COLOR);
}
if(angriffb == 14)
{
ANGRIFF_COLOR = 0xFFFF0067;
GangZoneFlashForAll(GangZone[0],ANGRIFF_COLOR);
}
if(angriffb == 15)
{
ANGRIFF_COLOR = 0x00FFFF67;
GangZoneFlashForAll(GangZone[0],ANGRIFF_COLOR);
}
if(angriffb == 1)
{
ANGRIFF_COLOR = COLOR_GOLD;
GangZoneFlashForAll(GangZone[0],ANGRIFF_COLOR);
}
else
{
}
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
stock strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
forward SaveBase();
public SaveBase()
{
dini_IntSet("/folder/file.ini", "bOwner", 8);
}
Es gibt folgende Probleme:
- das Gangfightgebiet wird nicht angezeigt (vor einer Stunde war das noch anders und ich weiß nicht, was ich falsch gemacht habe)
- /bOwner und /startware funktionieren nicht (es kommt immer im Chat "* BaseBesitzer der Base Nr. 1 in 0.000000 geändert." oder so ähnlich)
Vielen Dank im Vorraus!!!
/edit: Bitte nicht so hard sein, wenn ich was falsch gemacht habe, versuche mich das erste Mal an dini