Actor Bug
#1

Hello SA-MP. Today I had one idea about creating actors and save thier position in MySQL. MySQL loaded everything okay, I check few time mySQL debug. But when I try to create actor via simple command it`s not working. Why I don`t know. I made one thread in Scritpting Help but no body knows how to fix it. I read few time topic in SA-MP wiki but still not working. Here is the code, people here was testing code, also for them actor wasn`t spawned.

PHP код:
CMD:actor(playeridparams[])
{
    
actor1 CreateActor(4769.6655,323.3286,19.8828,356.4192);
    
SetPlayerPos(playerid769.6655,323.3286,19.8828);
    
SendDebug(playerid"Actor created!");
    return 
1;
}
CMD:destroy(playeridparams[])
{
    
DestroyActor(actor1);
    
SendDebug(playerid"Actor destroyed!");
    return 
1;

Reply
#2

The command seems to work for me?
http://prntscr.com/9osxh5
http://prntscr.com/9osxmd

Is there anything that could be conflicting?
Reply
#3

@Sanady, everything works fine for me too. Make sure you have updated your pawno includes and samp to 0.3.7 version.
Also, as there is a limit for actors, it is possible that more than 1000 actors were created somewhere in your gamemode and the one you are going to create in not spawning because of the limit.
Another thing that comes to my mind - check your gamemode/filterscript and/or includes for CreateActor function hooks. Maybe there is one that doesn't do what it has to.
Reply
#4

Quote:
Originally Posted by valych
Посмотреть сообщение
@Sanady, everything works fine for me too. Make sure you have updated your pawno includes and samp to 0.3.7 version.
Also, as there is a limit for actors, it is possible that more than 1000 actors were created somewhere in your gamemode and the one you are going to create in not spawning because of the limit.
Another thing that comes to my mind - check your gamemode/filterscript and/or includes for CreateActor function hooks. Maybe there is one that doesn't do what it has to.
It`s impossible, becouse that`s only actore in my whole script, so I don`t know, friend of my tested and for him it`s working fine. I don`t know.
Reply
#5

Make a loop through all possible actor ID's and see if they are valid with IsValidActor. If they are turning up to be valid then there is actors being created that you are not aware of. Now, see if 'actor1' is a valid actor with IsValidActor (do this in your creating command AND the destroying command). Post your results.

Just typical debugging. Always do typical debugging before posting here (no, your command was not enough).
Reply
#6

I think i have the same problem, i have a dynamic actor system ( using mysql ), for exemple i got 2 actors to load, the first when will be created and when the second one will be loaded, the first actor going to Destroy i didn't find fix for that at now.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)