Actor disapperars.
#1

I am making a pet system by using actors. When I create a actor it works but when I restart the server, actor doesn't show. Just actor's text is showing. The codes that I am using to create a actor:
Code:
PetData[i][petActor] = CreateActor(PetData[i][petSkin], PetData[i][petPos][0], PetData[i][petPos][1], PetData[i][petPos][2], PetData[i][petPos][3]);
SetActorVirtualWorld(PetData[i][petActor], PetData[i][petExteriorVW]);
Reply
#2

put at gamemodeinit
Reply
#3

Actor is showing before, but after it disappears.
Reply
#4

Code:
Pet_Refresh(petid)
{
	if (petid != -1 && PetData[petid][petExists])
	{
		if (IsValidDynamic3DTextLabel(PetData[petid][petText3D]))
		    DestroyDynamic3DTextLabel(PetData[petid][petText3D]);
		    
		if (IsValidActor(PetData[petid][petActor]))
			DestroyActor(PetData[petid][petActor]);

        PetTur_Guncelle(petid);
		new string[1024];
        format(string, sizeof(string), "%s %s (#%d)\n%s\nSaglik: %.4f\nAclik: %.4f", PetData[petid][petAdi], petdurum(petid), petid, PetData[petid][petTurAdi], PetData[petid][petSaglik], PetData[petid][petAclik]);
		PetData[petid][petText3D] = CreateDynamic3DTextLabel(string, 0x33AA33FF, PetData[petid][petPos][0], PetData[petid][petPos][1], PetData[petid][petPos][2], 5.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, PetData[petid][petExteriorVW], PetData[petid][petExterior]);
        PetData[petid][petActor] = CreateActor(PetData[petid][petSkin], PetData[petid][petPos][0], PetData[petid][petPos][1], PetData[petid][petPos][2], PetData[petid][petPos][3]);
        SetActorVirtualWorld(PetData[petid][petActor], PetData[petid][petExteriorVW]);
	}
	return 1;
}
I made pet_save, pet_load and pet_refresh. These are working successfully. Pet_load is at gamemodeinit.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)