SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 16/07/2012, 11:07 AM   #31
Mauzen
High-roller
 
Mauzen's Avatar
 
Join Date: Jun 2007
Location: Western Germany
Posts: 4,119
Reputation: 1020
Default Re: Simple AI Police Officer NPC using RNPC

Yep, I didnt consider any deaths in it. Youll probably need to restart the playback when the npc respawned, e.g. by calling OnNPCFinishPlayback manually.

Also heres an example code i just PMed someone, to fix the problems with NPCs not moving after spawn:
pawn Code:
new pol;
public OnGameModeInit() {
    SetTimer("ConnectAllNPCs", 5000, 0);
}

public ConnectAllNPCs() {
    // Connect the NPC after the gamemode is loaded
    pol = ConnectRNPC("Police");
    // Add all waypoints or other NPCs...
    SetTimer("StartAllRoutes", 500, 0);
}

public StartAllRoutes() {
    StartRPOLRoute(pol);
    // etc
}
Mauzen is offline   Reply With Quote
Old 17/07/2012, 09:39 PM   #32
Marricio
Gangsta
 
Join Date: Dec 2010
Posts: 608
Reputation: 53
Default Re: Simple AI Police Officer NPC using RNPC

Why when i get near the NPC it reaches the target and stops? It's pretty annoying.
Also, when I change the weapon id 22 to another one, it keeps placing the id 22 instead of the new one. I tried deleting all the recording files but still.
Marricio is offline   Reply With Quote
Old 29/07/2012, 06:49 PM   #33
lost13
Gangsta
 
Join Date: Aug 2009
Posts: 561
Reputation: 2
Default Re: Simple AI Police Officer NPC using RNPC

not working, script sends in chat to many msgs RNPC 001 or what.
__________________
lost13 is offline   Reply With Quote
Old 02/08/2012, 09:49 AM   #34
ahmed2793
Big Clucker
 
ahmed2793's Avatar
 
Join Date: Jul 2011
Posts: 73
Reputation: 5
Default Re : Simple AI Police Officer NPC using RNPC

does this need a record file to work?
__________________
ahmed2793 is offline   Reply With Quote
Old 03/08/2012, 05:55 PM   #35
ahmed2793
Big Clucker
 
ahmed2793's Avatar
 
Join Date: Jul 2011
Posts: 73
Reputation: 5
Default Re : Simple AI Police Officer NPC using RNPC

worked for me but when i add second npc it doesn't move then it leaves server(timeout) after some time.
__________________
ahmed2793 is offline   Reply With Quote
Old 05/08/2012, 08:59 PM   #36
Mauzen
High-roller
 
Mauzen's Avatar
 
Join Date: Jun 2007
Location: Western Germany
Posts: 4,119
Reputation: 1020
Default Re: Re : Simple AI Police Officer NPC using RNPC

Quote:
Originally Posted by ahmed2793 View Post
worked for me but when i add second npc it doesn't move then it leaves server(timeout) after some time.
Thats a RNPC bug, it will be fixed with the next update (i hope )
Oh, and no, it doesnt need record files as the plugin generates them automatically.
Mauzen is offline   Reply With Quote
Old 20/08/2012, 11:38 AM   #37
int3s0
Huge Clucker
 
int3s0's Avatar
 
Join Date: Feb 2011
Location: Europe, Croatia
Posts: 365
Reputation: 75
Default Re: Simple AI Police Officer NPC using RNPC

When I increase MAX_RNPC_POLICE and try to compile my gamemode I get this error:

error 052: multi-dimensional arrays must be fully initialized

How can I fix this?
int3s0 is offline   Reply With Quote
Old 20/08/2012, 12:43 PM   #38
Mauzen
High-roller
 
Mauzen's Avatar
 
Join Date: Jun 2007
Location: Western Germany
Posts: 4,119
Reputation: 1020
Default Re: Simple AI Police Officer NPC using RNPC

You need to fill this array
pawn Code:
new rpol[MAX_RNPC_POLICE][RPol_enum] = {{-1, -1, 0.0, 0.0, 0.0, 0, 0, -1}, {-1, -1, 0.0, 0.0, 0.0, 0, 0, -1},
        {-1, -1, 0.0, 0.0, 0.0, 0, 0, -1}, {-1, -1, 0.0, 0.0, 0.0, 0, 0, -1}, {-1, -1, 0.0, 0.0, 0.0, 0, 0, -1},
        {-1, -1, 0.0, 0.0, 0.0, 0, 0, -1}, {-1, -1, 0.0, 0.0, 0.0, 0, 0, -1}, {-1, -1, 0.0, 0.0, 0.0, 0, 0, -1} };

and add/remove more {-1, -1, 0.0, 0.0, 0.0, 0, 0, -1} until it got the correct size. I was too lazy to hook a init function that fills the array automaitcally
Mauzen is offline   Reply With Quote
Old 20/08/2012, 12:57 PM   #39
int3s0
Huge Clucker
 
int3s0's Avatar
 
Join Date: Feb 2011
Location: Europe, Croatia
Posts: 365
Reputation: 75
Default Re: Simple AI Police Officer NPC using RNPC

Quote:
Originally Posted by Mauzen View Post
You need to fill this array
pawn Code:
new rpol[MAX_RNPC_POLICE][RPol_enum] = {{-1, -1, 0.0, 0.0, 0.0, 0, 0, -1}, {-1, -1, 0.0, 0.0, 0.0, 0, 0, -1},
        {-1, -1, 0.0, 0.0, 0.0, 0, 0, -1}, {-1, -1, 0.0, 0.0, 0.0, 0, 0, -1}, {-1, -1, 0.0, 0.0, 0.0, 0, 0, -1},
        {-1, -1, 0.0, 0.0, 0.0, 0, 0, -1}, {-1, -1, 0.0, 0.0, 0.0, 0, 0, -1}, {-1, -1, 0.0, 0.0, 0.0, 0, 0, -1} };

and add/remove more {-1, -1, 0.0, 0.0, 0.0, 0, 0, -1} until it got the correct size. I was too lazy to hook a init function that fills the array automaitcally
Thanks, it's working!

I may have some more questions soon :P

EDIT:

With using this include my gamemode timers are not started for example:

SetTimer("Hi", 3000, false);
int3s0 is offline   Reply With Quote
Old 20/08/2012, 01:14 PM   #40
Niko_boy
High-roller
 
Niko_boy's Avatar
 
Join Date: Aug 2010
Location: Somewhere i belong
Posts: 1,415
Reputation: 137
Default Re: Simple AI Police Officer NPC using RNPC

oh now i finaly understood its one of use :P
one again great work Mauzen
__________________
$$$ If anyone want to get any of these:
  • DM/TDM/Freeroam/Stunt server, filterscripts or Bug fixing.or some general mapping. Above all any of the logos and banners or signature sorta stuff aswell.at some cheap and worth-full prices.
can Contact me for more info or a deal.
•••[0.3x]LCS•Freeroam•DM•Stunts•Race•Parkour•••AutoArena [0.3z][No SkinShot][sixtytiger.com]Want a decent Attack Defend Gamemode?
176.31.120.76:7777176.31.229.148:7830Get This! Attack-Defend(v2.3.1)
Niko_boy is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Npc programming a police officer slymatt Help Archive 19 30/07/2011 03:06 AM
argonath RPG police officer job sandisk125 Help Archive 10 19/11/2010 11:04 AM
[FilterScript] [FS] Police Officer Job refshal Filterscripts 13 18/12/2009 10:09 PM
How to make myself a police officer? Jordan69 Help Archive 7 03/08/2009 02:31 AM


All times are GMT. The time now is 07:05 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.