Hey..
Habe ein Problem bei einer Include, was ich erst gestern bemerkte..
Habe ja vor einiger Zeit mal eine Include rausgebracht, wo das Leben, die Schutzweste und das Geld Serverside ist..
Jedoch wird das Mainscript dadurch unterbrochen, OnGameModeInit wird nichteinmal aufgerufen..
Wenn ich die Definitionen der Callbacks entferne, klappt alles perfekt, jedoch kommt es dadurch zu Errors, da "OnGameModeInit" usw ja bereits vorhanden ist..
Weiß nicht mehr weiter..
Kann mir jemand vlt helfen?
#if !defined _samp_included
#include <a_samp>
#endif
#if !defined _Progress_included
#include <Progress>
#endif
forward SS_OnGameModeExit();
forward SS_OnPlayerConnect(playerid);
forward SS_OnPlayerDeath(playerid,killerid,reason);
forward SS_OnPlayerDisconnect(playerid, reason);
forward SS_OnPlayerSpawn(playerid);
forward SS_OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart);
forward SetArmour(playerid,Float:_armour);
forward GetArmour(playerid);
forward GiveHealth(playerid,Float:_health);
forward SetHealth(playerid,Float:_health);
forward GetHealth(playerid);
forward GiveMoney(playerid,_money);
forward SetMoney(playerid,_money);
forward GetMoney(playerid);
enum TDA_Player{
PlayerText:Geld,
PlayerText:HP,
PlayerText:AP,
Bar:HP_,
Bar:AP_
}
static TD[MAX_PLAYERS][TDA_Player];
Float:SS_Health,
Float:SS_Armour,
SS_Money,
bool:SS_KillHim
}
static SS_Player[MAX_PLAYERS][SS_E];
print(" Serverside Health, Armour, Money | Loaded | By ErikSon");
TDA[0] = TextDrawCreate(642.000000, 114.000000, ".");
TextDrawBackgroundColor(TDA[0], 255);
TextDrawFont(TDA[0], 1);
TextDrawLetterSize(TDA[0], 0.500000, 10.999999);
TextDrawColor(TDA[0], 136);
TextDrawSetOutline(TDA[0], 0);
TextDrawSetProportional(TDA[0], 1);
TextDrawSetShadow(TDA[0], 1);
TextDrawUseBox(TDA[0], 1);
TextDrawBoxColor(TDA[0], 0x82828288);
TextDrawTextSize(TDA[0], 490.000000, 0.000000);
TextDrawSetSelectable(TDA[0], 0);
TextDrawBackgroundColor(TDA[1], 255);
TextDrawFont(TDA[1], 0);
TextDrawLetterSize(TDA[1], 0.500000, 2.000000);
TextDrawColor(TDA[1], 0x00B70A66);
TextDrawSetOutline(TDA[1], 0);
TextDrawSetProportional(TDA[1], 1);
TextDrawSetShadow(TDA[1], 1);
TextDrawSetSelectable(TDA[1], 0);
TextDrawBackgroundColor(TDA[2], 255);
TextDrawFont(TDA[2], 3);
TextDrawLetterSize(TDA[2], 0.500000, 2.000000);
TextDrawColor(TDA[2], 0xFF0A0066);
TextDrawSetOutline(TDA[2], 0);
TextDrawSetProportional(TDA[2], 1);
TextDrawSetShadow(TDA[2], 1);
TextDrawSetSelectable(TDA[2], 0);
TextDrawBackgroundColor(TDA[3], 255);
TextDrawFont(TDA[3], 3);
TextDrawLetterSize(TDA[3], 0.500000, 2.700000);
TextDrawColor(TDA[3], 0x0071FF66);
TextDrawSetOutline(TDA[3], 0);
TextDrawSetProportional(TDA[3], 1);
TextDrawSetShadow(TDA[3], 1);
TextDrawSetSelectable(TDA[3], 0);
TD[i][Geld] = CreatePlayerTextDraw(i,633.000000, 188.000000, "999999999"); //Geld
PlayerTextDrawAlignment(i,TD[i][Geld], 3);
PlayerTextDrawBackgroundColor(i,TD[i][Geld], 255);
PlayerTextDrawFont(i,TD[i][Geld], 2);
PlayerTextDrawLetterSize(i,TD[i][Geld], 0.500000, 2.000000);
PlayerTextDrawColor(i,TD[i][Geld], 0x00B70A66);
PlayerTextDrawSetOutline(i,TD[i][Geld], 0);
PlayerTextDrawSetProportional(i,TD[i][Geld], 1);
PlayerTextDrawSetShadow(i,TD[i][Geld], 1);
PlayerTextDrawSetSelectable(i,TD[i][Geld], 0);
TD[i][HP] = CreatePlayerTextDraw(i,633.000000, 122.000000, "100"); // Hp
PlayerTextDrawAlignment(i,TD[i][HP], 3);
PlayerTextDrawBackgroundColor(i,TD[i][HP], 255);
PlayerTextDrawFont(i,TD[i][HP], 2);
PlayerTextDrawLetterSize(i,TD[i][HP], 0.500000, 2.000000);
PlayerTextDrawColor(i,TD[i][HP], 0xFF0A0066);
PlayerTextDrawSetOutline(i,TD[i][HP], 0);
PlayerTextDrawSetProportional(i,TD[i][HP], 1);
PlayerTextDrawSetShadow(i,TD[i][HP], 1);
PlayerTextDrawSetSelectable(i,TD[i][HP], 0);
PlayerTextDrawAlignment(i,TD[i][AP], 3);
PlayerTextDrawBackgroundColor(i,TD[i][AP], 255);
PlayerTextDrawFont(i,TD[i][AP], 2);
PlayerTextDrawLetterSize(i,TD[i][AP], 0.500000, 2.000000);
PlayerTextDrawColor(i,TD[i][AP], 0x0071FF66);
PlayerTextDrawSetOutline(i,TD[i][AP], 0);
PlayerTextDrawSetProportional(i,TD[i][AP], 1);
PlayerTextDrawSetShadow(i,TD[i][AP], 1);
PlayerTextDrawSetSelectable(i,TD[i][AP], 0);
TD[i][AP_] = CreateProgressBar(524.00, 160.00, 71.50, 13.50, 0x0071FF66, 100.0);
TD[i][HP_] = CreateProgressBar(524.00, 128.00, 71.50, 13.50, 0xFF0A0066, 100.0);
}
return CallLocalFunction("SS_OnGameModeInit","");
}
new i = 0;
for(i = 0; i<4; i++)TextDrawDestroy(TDA[i]);
for(i = 0; i<MAX_PLAYERS; i++)PlayerTextDrawDestroy(i,TD[i][Geld]),PlayerTextDrawDestroy(i,TD[i][HP]),PlayerTextDrawDestroy(i,TD[i][AP]);
return CallLocalFunction("SS_OnGameModeExit","");
}
SetHealth(playerid,100),SetArmour(playerid,0),SetMoney(playerid,0),
SS_Player[playerid][SS_KillHim] = false;
return CallLocalFunction("SS_OnPlayerConnect","i",playerid);
}
for(new i = 0; i<4; i++)TextDrawHideForPlayer(playerid,TDA[i]);
PlayerTextDrawHide(playerid,TD[playerid][Geld]),
PlayerTextDrawHide(playerid,TD[playerid][HP]),
PlayerTextDrawHide(playerid,TD[playerid][AP]),
HideProgressBarForPlayer(playerid,TD[playerid][HP_]),
HideProgressBarForPlayer(playerid,TD[playerid][AP_]);
return CallLocalFunction("SS_OnPlayerDisconnect","ii",playerid,reason);
}
if(!SS_Player[playerid][SS_Health])GiveHealth(playerid,100);
SS_Player[playerid][SS_KillHim] = false;
for(new i = 0; i<4; i++)TextDrawShowForPlayer(playerid,TDA[i]);
PlayerTextDrawShow(playerid,TD[playerid][Geld]),
PlayerTextDrawShow(playerid,TD[playerid][HP]),
PlayerTextDrawShow(playerid,TD[playerid][AP]),
ShowProgressBarForPlayer(playerid,TD[playerid][HP_]),
ShowProgressBarForPlayer(playerid,TD[playerid][AP_]);
return CallLocalFunction("SS_OnPlayerSpawn","i",playerid);
}
SetHealth(playerid,100),SetArmour(playerid,0);
return CallLocalFunction("SS_OnPlayerDeath","iii",playerid,killerid,reason);
}
new Float:amount2;
SetPlayerHealth(playerid,100);
if(SS_Player[playerid][SS_Armour] >= 1 && issuerid != INVALID_PLAYER_ID){
amount2 = (amount - SS_Player[playerid][SS_Armour]);
GiveArmour(playerid,-amount);
if(amount2)GiveHealth(playerid,-amount2);
}
else{
GiveHealth(playerid,-amount);
if(SS_Player[playerid][SS_Health] <= 0 && SS_Player[playerid][SS_KillHim])SetPlayerHealth(playerid,0);
}
return CallLocalFunction("SS_OnPlayerTakeDamage","iifii",playerid, issuerid, amount, weaponid, bodypart);
}
SS_Player[playerid][SS_Armour] += _armour;
if(SS_Player[playerid][SS_Armour] > 999)SS_Player[playerid][SS_Armour] = 999;
if(SS_Player[playerid][SS_Armour] < 0)SS_Player[playerid][SS_Armour] = 0;
new str[4]; format(str,sizeof(str),"%.0f",SS_Player[playerid][SS_Armour]);
SetProgressBarValue(TD[playerid][AP_],floatround(SS_Player[playerid][SS_Armour]));
UpdateProgressBar(TD[playerid][AP_],playerid);
return PlayerTextDrawSetString(playerid,TD[playerid][AP],str);
}
public SetArmour(playerid,Float:_armour){
SS_Player[playerid][SS_Armour] = _armour;
if(SS_Player[playerid][SS_Armour] > 999)SS_Player[playerid][SS_Armour] = 999;
if(SS_Player[playerid][SS_Armour] < 0)SS_Player[playerid][SS_Armour] = 0;
new str[4]; format(str,sizeof(str),"%.0f",SS_Player[playerid][SS_Armour]);
SetProgressBarValue(TD[playerid][AP_],floatround(SS_Player[playerid][SS_Armour])),
UpdateProgressBar(TD[playerid][AP_],playerid);
return PlayerTextDrawSetString(playerid,TD[playerid][AP],str);
}
public GetArmour(playerid)return floatround(SS_Player[playerid][SS_Armour]);
SS_Player[playerid][SS_Health] += _health;
if(SS_Player[playerid][SS_Health] > 999)SS_Player[playerid][SS_Health] = 999;
new str[4]; format(str,sizeof(str),"%.0f",SS_Player[playerid][SS_Health]);
SetProgressBarValue(TD[playerid][HP_],floatround(SS_Player[playerid][SS_Health]));
UpdateProgressBar(TD[playerid][HP_],playerid);
if(SS_Player[playerid][SS_Health] <= 0)SS_Player[playerid][SS_KillHim] = true, SetPlayerHealth(playerid,0);
return PlayerTextDrawSetString(playerid,TD[playerid][HP],str);
}
public SetHealth(playerid,Float:_health){
SS_Player[playerid][SS_Health] = _health;
if(SS_Player[playerid][SS_Health] > 999)SS_Player[playerid][SS_Health] = 999;
new str[4]; format(str,sizeof(str),"%.0f",SS_Player[playerid][SS_Health]);
SetProgressBarValue(TD[playerid][HP_],floatround(SS_Player[playerid][SS_Health]));
UpdateProgressBar(TD[playerid][HP_],playerid);
if(SS_Player[playerid][SS_Health] <= 0)SS_Player[playerid][SS_KillHim] = true, SetPlayerHealth(playerid,0);
return PlayerTextDrawSetString(playerid,TD[playerid][HP],str);
}
public GetHealth(playerid)return floatround(SS_Player[playerid][SS_Health]);
SS_Player[playerid][SS_Money] += _money;
if(SS_Player[playerid][SS_Money] > 999999999)SS_Player[playerid][SS_Money] = 999999999;
new str[16]; format(str,sizeof(str),"%i",SS_Player[playerid][SS_Money]);
return PlayerTextDrawSetString(playerid,TD[playerid][Geld],str);
}
public SetMoney(playerid,_money){
SS_Player[playerid][SS_Money] = _money;
if(SS_Player[playerid][SS_Money] > 999999999)SS_Player[playerid][SS_Money] = 999999999;
new str[16]; format(str,sizeof(str),"%i",SS_Player[playerid][SS_Money]);
return PlayerTextDrawSetString(playerid,TD[playerid][Geld],str);
}
public GetMoney(playerid)return SS_Player[playerid][SS_Money];
#undef OnPlayerConnect
#else
#define _ALS_OnPlayerConnect
#endif
#define OnPlayerConnect SS_OnPlayerConnect
#if defined _ALS_OnGameModeInit
#undef OnGameModeInit
#else
#define _ALS_OnGameModeInit
#endif
#define OnGameModeInit SS_OnGameModeInit
#undef OnGameModeExit
#else
#define _ALS_OnGameModeExit
#endif
#define OnGameModeExit SS_OnGameModeExit
#if defined _ALS_OnPlayerSpawn
#undef OnPlayerSpawn
#else
#define _ALS_OnPlayerSpawn
#endif
#define OnPlayerSpawn SS_OnPlayerSpawn
#if defined _ALS_OnPlayerDeath
#undef OnPlayerDeath
#else
#define _ALS_OnPlayerDeath
#endif
#define OnPlayerDeath SS_OnPlayerDeath
#undef OnPlayerDisconnect
#else
#define _ALS_OnPlayerDisconnect
#endif
#define OnPlayerDisconnect SS_OnPlayerDisconnect
#undef OnPlayerTakeDamage
#else
#define _ALS_OnPlayerTakeDamage
#endif
#define OnPlayerTakeDamage SS_OnPlayerTakeDamage
Die Definitionen sind ganz unten..
Da ich dafür ein kleines Update rausbringen wollte, habe ich das mal getestet, jedoch bemerkte ich dann den Fehler..
Hoffe jemand kann mir helfen..
Danke im Voraus!