pawn Code:
#include <a_samp>
new textdrawtimer;
new Text:status_unten[MAX_PLAYERS];
new killsvonplayer[MAX_PLAYERS], Float:lebenfloatvonplayer[MAX_PLAYERS],
Float:armourfloatvonplayer[MAX_PLAYERS], Float:vehiclehealthfloatvonplayer[MAX_PLAYERS];
forward Anzeige(playerid);
public Anzeige(playerid)
{
new string[256];
new vehiclehealthtext[256];
for (new i; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
TextDrawDestroy(status_unten[i]);
killsvonplayer[i] = GetPlayerScore(i);
GetPlayerHealth(i,lebenfloatvonplayer[i]);
GetPlayerArmour(i,armourfloatvonplayer[i]);
GetVehicleHealth(GetPlayerVehicleID(i), vehiclehealthfloatvonplayer[i]);
if(IsPlayerInAnyVehicle(i))
{
if(vehiclehealthfloatvonplayer[i] > 650.0)
{
format(vehiclehealthtext, sizeof(vehiclehealthtext),"~w~VH:~g~ %.1f",vehiclehealthfloatvonplayer[i]-250);
}
if(vehiclehealthfloatvonplayer[i] <= 650.0)
{
format(vehiclehealthtext, sizeof(vehiclehealthtext),"~w~VH:~g~ %.1f",vehiclehealthfloatvonplayer[i]-250);
}
if(vehiclehealthfloatvonplayer[i] <= 550.0)
{
format(vehiclehealthtext, sizeof(vehiclehealthtext),"~w~VH:~y~ %.1f",vehiclehealthfloatvonplayer[i]-250);
}
if(vehiclehealthfloatvonplayer[i] <= 450.0)
{
format(vehiclehealthtext, sizeof(vehiclehealthtext),"~w~VH:~y~ %.1f",vehiclehealthfloatvonplayer[i]-250);
}
if(vehiclehealthfloatvonplayer[i] <= 350.0)
{
format(vehiclehealthtext, sizeof(vehiclehealthtext),"~w~VH:~r~ %.1f Warning",vehiclehealthfloatvonplayer[i]-250);
}
if(vehiclehealthfloatvonplayer[i] <= 250.0)
{
format(vehiclehealthtext, sizeof(vehiclehealthtext),"~w~VH:~r~ %.1f Warning",vehiclehealthfloatvonplayer[i]-250);
}
if(vehiclehealthfloatvonplayer[i] < 250.0)
{
format(vehiclehealthtext, sizeof(vehiclehealthtext),"~w~VH:~r~ %.1f Warning",0);
}
format(string, sizeof(string),"P:~g~ %d ~w~L:~g~ %.1f ~w~A:~g~ %.1f %s",killsvonplayer[i],lebenfloatvonplayer[i],armourfloatvonplayer[i], vehiclehealthtext);
status_unten[i] = TextDrawCreate(0.0, 432.0, string);
}
else
{
format(string, sizeof(string),"P:~g~ %d ~w~L:~g~ %.1f ~w~A:~g~ %.1f",killsvonplayer[i],lebenfloatvonplayer[i],armourfloatvonplayer[i]);
status_unten[i] = TextDrawCreate(0.0, 432.0, string);
}
TextDrawLetterSize(status_unten[i], 0.3, 1.5);
TextDrawUseBox(status_unten[i], true);
TextDrawBoxColor(status_unten[i], 0x000000cc);
TextDrawShowForPlayer(i,status_unten[i]);
}
}
}
public OnGameModeExit()
{
KillTimer(textdrawtimer);
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerInterior(playerid, 1);
SetPlayerPos(playerid, -784.8948,498.3206,1371.7422);
SetPlayerFacingAngle(playerid, 0.3642);
SetPlayerCameraPos(playerid, -784.8948,506.5578,1374.5422);
SetPlayerCameraLookAt(playerid, -784.8948,498.3206,1371.7422);
new info_string[255];
new request_string[255];
switch(classid)
{
case 0:
format(request_string, sizeof(request_string),"~g~Los Santos");
}
format(info_string, sizeof(info_string),"~w~Spawn: %s", request_string);
for (new i; i < MAX_PLAYERS; i++)
{
TextDrawDestroy(status_unten[i]);
}
status_unten[playerid] = TextDrawCreate(0.0, 432.0, info_string);
TextDrawLetterSize(status_unten[playerid], 0.3, 1.5);
TextDrawUseBox(status_unten[playerid], true);
TextDrawBoxColor(status_unten[playerid], 0x000000cc);
TextDrawShowForPlayer(playerid,status_unten[playerid]);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
for (new i; i < MAX_PLAYERS; i++)
{
TextDrawDestroy(status_unten[i]);
}
return 1;
}
public OnPlayerSpawn(playerid)
{
textdrawtimer = SetTimer("Anzeige",100,1);
return 1;
}
Why are you doing this
pawn Code:
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerInterior(playerid, 1);
SetPlayerPos(playerid, -784.8948,498.3206,1371.7422);
SetPlayerFacingAngle(playerid, 0.3642);
SetPlayerCameraPos(playerid, -784.8948,506.5578,1374.5422);
SetPlayerCameraLookAt(playerid, -784.8948,498.3206,1371.7422);
new info_string[255];
new request_string[255];
switch(classid)
{
case 0:
format(request_string, sizeof(request_string),"~g~Los Santos");
}
format(info_string, sizeof(info_string),"~w~Spawn: %s", request_string);
for (new i; i < MAX_PLAYERS; i++)
{
TextDrawDestroy(status_unten[i]);
}
status_unten[playerid] = TextDrawCreate(0.0, 432.0, info_string);
TextDrawLetterSize(status_unten[playerid], 0.3, 1.5);
TextDrawUseBox(status_unten[playerid], true);
TextDrawBoxColor(status_unten[playerid], 0x000000cc);
TextDrawShowForPlayer(playerid,status_unten[playerid]);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
for (new i; i < MAX_PLAYERS; i++)
{
TextDrawDestroy(status_unten[i]);
}
return 1;
}
everytime a player connects or disconnects it will destroy everyones textdraws ?