3d Text Label Problem
#1

function AttachPet(playerid, bool: attach) {
if(PlayerInfo[playerid][pPet] != 0)
{
if(attach == true) {
PetObject[playerid] = SetPlayerAttachedObject( playerid, 2, 19079, 1, 0.328340, -0.082576, -0.147006, 0.000000, 0.000000, 0.000000, 0.648338, 0.671368, 0.725697 );
new L_STRING[100], Float:lnx_pLoc[3];
format(L_STRING, sizeof(L_STRING), "{F7F300}Lvl %d.\n{15D100}%s", PlayerInfo[playerid][pPet], PlayerInfo[playerid][pPetName]);
GetObjectPos(PetObject[playerid], lnx_pLoc[0], lnx_pLoc[1], lnx_pLoc[2]);
Pet3DText[playerid] = CreateDynamic3DTextLabel(L_STRING, 0xFFFFFFFF, lnx_pLoc[0], lnx_pLoc[1], lnx_pLoc[2], 20);
lnx_UpdateLabelPos(playerid);
}
else {
RemovePlayerAttachedObject(playerid, 2);
Delete3DTextLabel(Pet3DText[playerid]);
}
}
return 1;
}

Does not apper to players or playerid.
Any ideas why?
Reply
#2

SetPlayerAttachedObject dont return the id of created object (Return Values: 1 on success, 0 on failure.) , so you should use
PHP код:
GetPlayerPos(playeridlnx_pLoc[0], lnx_pLoc[1], lnx_pLoc[2]); 
instead of
PHP код:
GetObjectPos(PetObject[playerid], lnx_pLoc[0], lnx_pLoc[1], lnx_pLoc[2]); 
Note: The created 3DText will not attach to player and will be placed at player position.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)