NPC should call function
#1

Hey guys,
At the moment, im scripting at a special bot. My problem is that i have
to call a function in the gamemode. CallRemoteFunction doesn't work in NPC_Scripts and
SendCommand doesn't work for me, because i use zcmd.

Hope someone can help me...
Reply
#2

What command do you wanna call ?
Reply
#3

This one:

Код:
CMD:starttour(playerid,params[])
{
	if(!IsPlayerNPC(playerid)) return 0;
    CheckTour(1);
    return 1;
}
Reply
#4

At OnGameModeInit:
pawn Код:
for( new i = 0; i < MAX_PLAYERS; i ++ ) cmd_starttour( 1 );
No more SendCommand:
cmd_[COMMAND](playerid, params);
Reply
#5

Isn't this calling the cmd for every player?
Reply
#6

Yes it is, why ?
Reply
#7

Only the bot should do this command.
And he should call it when the recording starts...
Reply
#8

Yes, but do you know...
pawn Код:
if(!IsPlayerNPC(playerid)) return 0;
Have you forgotted, is your code, dude )

But, it's better you do this at OnPlayerConnect, just like this:
pawn Код:
public OnPlayerConnect( playerid )
{
    cmd_starttour( playerid );
    return 1;
}
Reply
#9

!IsPlayerNPC = If he isn't a NPC
And still only the bot should call the cmd when he start the recording
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)