Problem #1:
//Attach3DTextLabelToDynamicActor
stock Text3D:A3DTLTDA(actorid, text[], color, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:distance = 10.0, testlos = 0)
{
s_DynamicActors[actorid][e_iActorNameLabel] = Text3D:INVALID_3DTEXT_ID;
if(IsValidDynamicActor(actorid))
{
new Float:x,Float:y,Float:z;
GetDynamicActorPos(actorid, x, y, z);
s_DynamicActors[actorid][e_iActorNameLabel] = CreateDynamic3DTextLabel(text, color, x + fOffsetX, y + fOffsetY, (z + 0.8) + fOffsetZ, distance, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, testlos);
}
return s_DynamicActors[actorid][e_iActorNameLabel];
}
Alles anzeigen
Die Funktion wird bei CreateDynamicActor aufgerufen:
stock CreateDynamicActor(modelid, Float:x, Float:y, Float:z, Float:angle, worldid = -1, interiorid = -1, const actorname[] = "UNKNOWN_ACTOR_NAME")
{
for (new i = 0; i < MAX_DYNAMIC_ACTORS; i ++)
{
if (!s_DynamicActors[i][e_iSlotUsed])
{
s_DynamicActors[i][e_iSlotUsed] = 1;
s_DynamicActors[i][e_iActorModel] = modelid;
s_DynamicActors[i][e_fActorX] = x;
s_DynamicActors[i][e_fActorY] = y;
s_DynamicActors[i][e_fActorZ] = z;
s_DynamicActors[i][e_fActorA] = angle;
s_DynamicActors[i][e_iActorVirtual] = worldid;
s_DynamicActors[i][e_iActorInterior] = interiorid;
s_DynamicActors[i][e_iActorID] = INVALID_ACTOR_ID;
format(s_DynamicActors[i][e_iActorName], MAX_PLAYER_NAME, actorname);
A3DTLTDA(i, s_DynamicActors[i][e_iActorName], 0xFEFEFEFF, 0.0, 0.0, 5.0, 10.0, 1);
s_DynamicActors[i][e_iActorTimer] = SetTimerEx("OnActorStreamUpdate", ACTOR_STREAM_TICK_RATE, true, "i", i);
return i;
}
}
return INVALID_ACTOR_ID;
}
Alles anzeigen
Das Label ist aber InGame nicht zu stehen.
Problem #2:
Die Funktion GetDynamicActorName gibt folgende Chatmessage wieder:
[17:49:01] [BOT] Pnload/get/?i=O 8pornR2NOwzbAfAXYNFNa 36CF3YFf0cXvSmV2c4D1 C8yHLgH CWgRUHFMs1414480475PBF1414480475HbIdKJFLhNfhTBzYQDD : Hallo German_ScripterHD.
stock:
stock GetDynamicActorName(actorid)
{
if (IsValidDynamicActor(actorid))
{
return s_DynamicActors[actorid][e_iActorName];
}
return 1;
}
Verwendung:
public OnPlayerText(playerid, text[])
{
LOOP(MAX_ACTORS,i){
if(IsValidDynamicActor(i)){
if(IsPlayerNearActor(playerid,i,10.0)){
if(!strcmp(text,"Hallo",true)){
SCMEx(playerid,-1,"[BOT] %s: Hallo %s.",GetDynamicActorName(i),_GetPlayerName(playerid));
}
}
}
}
return 0;
}
Alles anzeigen