Ja guten Abend bzw. Guten Morgen....
Bräuchte mal Hilfe bei 3D Wanted Label.
Bekomme es nicht gebacken das es lädt wenn ein Cop einen User Wanted Gibt, das dies dan ladet.
Ist dieser Spieler ein Cop ?
Abfrage funkt.
public IsACop(playerid)
{
if(IsPlayerConnected(playerid))
{
new leader = PlayerInfo[playerid][pLeader];
new member = PlayerInfo[playerid][pMember];
if(member==1 || member==2 || member==21)
{
return 1;
}
else if(leader==1 || leader==2 || leader==21)
{
return 1;
}
}
return 0;
}
Nun new forward und wo der Timer steckt.
//forward
forward CheckWantedText();
forward OtherTimer();
//new
new PlayerText3D:WantedLabel[MAX_PLAYERS][MAX_PLAYERS];
new LabelCreated[MAX_PLAYERS][MAX_PLAYERS];
//Timer
othtimer = SetTimer("OtherTimer", 1000, 1);
public OtherTimer()
{
CheckWantedText();
return 1;
}
public CheckWantedText()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(!IsACop(i))
{
for(new suspect=0; suspect<MAX_PLAYERS; suspect++)
{
if(IsPlayerConnected(i))
{
new reason[60];
format(reason, sizeof reason,"%s",PlayerCrime[suspect][pAccusedof]);
new turner[60];
format(turner, sizeof turner,"%s", PlayerCrime[suspect][pVictim]);
new string[90];
if(WantedLevel[suspect] > 0)
{
new name[30],Float:X, Float:Y, Float:Z;
GetPlayerPos(suspect, X, Y, Z);
GetPlayerName(suspect, name, sizeof name);
if(LabelCreated[i][suspect] == 0)
{
format(string,sizeof(string),"[%d]%s \nWantedlevel: %d\nGrund: %s\nZeuge: %s",suspect,name,WantedLevel[suspect],reason,turner);
WantedLabel[i][suspect] = CreatePlayer3DTextLabel(i,string,COLOR_LIGHTRED,X,Y,Z+0.7,40.0,suspect,INVALID_VEHICLE_ID,0);
LabelCreated[i][suspect] = 1;
}
else
{
format(string,sizeof(string),"[%d]%s \nWantedlevel: %d\nGrund: %s\nZeuge: %s",suspect,name,WantedLevel[suspect],reason,turner);
UpdatePlayer3DTextLabelText(suspect, WantedLabel[i][suspect], COLOR_LIGHTRED,string);
}
}
if(LabelCreated[i][suspect] == 1)
{
if(WantedLevel[suspect] < 1)
{
DeletePlayer3DTextLabel(suspect,WantedLabel[i][suspect]);
}
}
}
}
}
}
}
}
Ich bring es nicht zusammen das das Teil einfach LADET.
Hat eventuell von euch einer mehr Erfahrung ?
LG