23.02.2013, 14:26
I'm looking for a detailed difference between -
https://sampwiki.blast.hk/wiki/NPC:OnPlayerText
and
https://sampwiki.blast.hk/wiki/OnPlayerText
Also, I was wondering how exactly an NPC works.
If an NPC runs as a completely different script, we could put some major pieces of code not involving main players away from the MAIN script into the NPC's pawn file and perform them in the NPC's script which would cause less lag yet work the same way?
Instead of running massive string checks under OnPlayerText, we could run these checks under the NPC's script and separate these from the main script, which would probably reduce the load (this can make a big difference in a 300-400 player server/800-1000 player server)
Same for the other functions we're provided with in a_npc
Also, I'm looking for an explanation of SendChat and SendCommand in NPC scripts since there's no wiki documentation on this, I want to know how this works.
Can someone enlighten me?
My main question - Do NPC's run on completely different scripts from the main gamemode? If yes, can they accurately handle the SAME code as the main gamemode
And even if this is possible, how much would this be accurate and how can this be useful/a disadvantage?
https://sampwiki.blast.hk/wiki/NPC:OnPlayerText
and
https://sampwiki.blast.hk/wiki/OnPlayerText
Also, I was wondering how exactly an NPC works.
If an NPC runs as a completely different script, we could put some major pieces of code not involving main players away from the MAIN script into the NPC's pawn file and perform them in the NPC's script which would cause less lag yet work the same way?
Instead of running massive string checks under OnPlayerText, we could run these checks under the NPC's script and separate these from the main script, which would probably reduce the load (this can make a big difference in a 300-400 player server/800-1000 player server)
Same for the other functions we're provided with in a_npc
Also, I'm looking for an explanation of SendChat and SendCommand in NPC scripts since there's no wiki documentation on this, I want to know how this works.
Can someone enlighten me?
My main question - Do NPC's run on completely different scripts from the main gamemode? If yes, can they accurately handle the SAME code as the main gamemode
And even if this is possible, how much would this be accurate and how can this be useful/a disadvantage?