07.07.2011, 22:18
(
Последний раз редактировалось erorcun; 03.08.2011 в 17:01.
)
SuperNova NPC System Beta 1.1
The new CNPC has been created!
You don't need npcmodes folder and OnPlayerRequestClass anymore. The only thing you should do is moving bot.amx file to the npcmodes folder from downloaded file. All NPCs will use bot.amx file. Then, add "new streamid = CreateStreamedNPC(...)" line to anywhere in gm. You will use SetNPCxxx(streamid.. functions instead of SetPlayerxxx(playerid.. functions. And if you want to remove npc, you will use DestroyStreamedNPC function.
If you want a bot to walk to a certain location, you can use 2 method.
1- WalkNPC(streamid_returned_from_create_function, walkid_for_walkend_callback, x,y,z,bool:run)
2- I copied playback recording functions to gamemode from npcmodes. You can use playback function.
Default NPC system? Can I use "ConnectNPC"?
No. You must use my system for all NPCs.
Will we use playerid?
No. CreateStreamedNPC will return stream id and you will use streamid for all NPC actions. Don't use player functions (SetPlayerPos etc.).
Why we must use streamid? Can't we use playerid?
System includes streamer. In some cases, NPCs will not be connected. When it connected/streamed in, it will have another playerid. But streamid will never change.
Is there something we should be aware of?
maxnpc limit in server.cfg and define's at the top of the file.
NPC walk system can be affected from lag problem in 0.3c. (https://sampforum.blast.hk/showthread.php?tid=212017)
It is one more thing you shouldn't forget, script is in the beta stage.
Callbacks
- OnNPCWalkEnd(streamid,walkid,method)
walkid should be entered to WalkNPC command.
Methods:
0- Automaticly.
1- By StopWalkNPC command.
2- You started playback and walking automaticly stoped.
- OnNPCRecordingPlaybackEnd(streamid)
Copied to gamemode from npcmodes.
Functions
Download
Waiting for your feedback.
b1: http://solidfiles.com/d/efa184/
b1.1: http://solidfiles.com/d/9eab/
The new CNPC has been created!
You don't need npcmodes folder and OnPlayerRequestClass anymore. The only thing you should do is moving bot.amx file to the npcmodes folder from downloaded file. All NPCs will use bot.amx file. Then, add "new streamid = CreateStreamedNPC(...)" line to anywhere in gm. You will use SetNPCxxx(streamid.. functions instead of SetPlayerxxx(playerid.. functions. And if you want to remove npc, you will use DestroyStreamedNPC function.
If you want a bot to walk to a certain location, you can use 2 method.
1- WalkNPC(streamid_returned_from_create_function, walkid_for_walkend_callback, x,y,z,bool:run)
2- I copied playback recording functions to gamemode from npcmodes. You can use playback function.
Default NPC system? Can I use "ConnectNPC"?
No. You must use my system for all NPCs.
Will we use playerid?
No. CreateStreamedNPC will return stream id and you will use streamid for all NPC actions. Don't use player functions (SetPlayerPos etc.).
Why we must use streamid? Can't we use playerid?
System includes streamer. In some cases, NPCs will not be connected. When it connected/streamed in, it will have another playerid. But streamid will never change.
Is there something we should be aware of?
maxnpc limit in server.cfg and define's at the top of the file.
NPC walk system can be affected from lag problem in 0.3c. (https://sampforum.blast.hk/showthread.php?tid=212017)
It is one more thing you shouldn't forget, script is in the beta stage.
Callbacks
- OnNPCWalkEnd(streamid,walkid,method)
walkid should be entered to WalkNPC command.
Methods:
0- Automaticly.
1- By StopWalkNPC command.
2- You started playback and walking automaticly stoped.
- OnNPCRecordingPlaybackEnd(streamid)
Copied to gamemode from npcmodes.
Functions
pawn Код:
public CreateStreamedNPC(const name[], skin, Float:x, Float:y, Float:z, Float:angle,viwo)
public DestroyStreamedNPC(streamid)
public WalkNPC(streamid,walkid,Float:x,Float:y,Float:z,bool:run)
public StopWalkNPC(streamid)
public SetNPCPos(streamid,Float:x,Float:y,Float:z)
public SetNPCFacingAngle(streamid,Float:angle)
public SetNPCVirtualWorld(streamid,viwo)
public SetNPCSkin(streamid,skinid)
public ApplyNPCAnimation(streamid,animlibs[],animnames[],Float:fS,timer,freeze,loop)
public ClearNPCAnimations(streamid)
public StartRecordingPlayback(streamid,playbacktype,recordname[])
public StopRecordingPlayback(streamid)
Waiting for your feedback.
b1: http://solidfiles.com/d/efa184/
b1.1: http://solidfiles.com/d/9eab/