bots+sagc rp need help!please
#1

So everything is good except I need to trick the server into thinking that the bots are logged in and registred so I think I got it.
I got this under onplayerconnect
Код:
  if(IsPlayerNPC(playerid))
  PlayerInfo[playerid][gPlayerLogged] =1
and when compling I get this for an answer
Код:
C:\Documents and Settings\Kristian\Skrivbord\0.3\gamemodes\sagc.pwn(1399) : error 033: array must be indexed (variable "gPlayerLogged")
C:\Documents and Settings\Kristian\Skrivbord\0.3\gamemodes\sagc.pwn(1401) : error 001: expected token: ";", but found "-identifier-"
so please help me if you can I'd really like to have some bots driving around since the server wont have many players in the beginning :P
Reply
#2

you could try

Код:
new gPlayerLogged
  if(IsPlayerNPC(playerid))
  PlayerInfo[playerid][gPlayerLogged] =1
as for the expected ; you need to post more of your code to see where ya need to place that thing

im no scripter but that should work i think
Reply
#3

i, you must set if(IsPlayerNPC(playerid)) return 1; in OnPlayerSpawn like this
Код:
public OnPlayerRequestClass(playerid, classid)
{
  if(IsPlayerNPC(playerid)) return 1;
Code ...
}
and OnPlayerRequestClass ...

That and your bot normally spawn and walk !!
Reply
#4

Quote:
Originally Posted by zimtar
you could try

Код:
new gPlayerLogged
 if(IsPlayerNPC(playerid))
  PlayerInfo[playerid][gPlayerLogged] =1
as for the expected ; you need to post more of your code to see where ya need to place that thing

im no scripter but that should work i think
is this supposed to be under onplayerconnect or?:P sorry for being nub
the second error is gone now anyways :P
Reply
#5

You forgot ;

pawn Код:
if(IsPlayerNPC(playerid)) PlayerInfo[playerid][gPlayerLogged] = 1;
Reply
#6

I suggest u to download athers npc's and lokk in their pawn then look what u have made wrong..
Reply
#7

I'm not creating a script for the NPC I'm fixing so it wont have to log in
Reply
#8

Quote:
Originally Posted by Don Correlli
You forgot ;

pawn Код:
if(IsPlayerNPC(playerid)) PlayerInfo[playerid][gPlayerLogged] = 1;
just add the ; like Don Said it should compile after that.
Reply
#9

Quote:
Originally Posted by Don Correlli
You forgot ;

pawn Код:
if(IsPlayerNPC(playerid)) PlayerInfo[playerid][gPlayerLogged] = 1;
after doing this I get this :/
Код:
C:\Documents and Settings\Kristian\Skrivbord\0.3\gamemodes\sagc.pwn(1398) : error 033: array must be indexed (variable "gPlayerLogged")
What is wrong :P I wish I were a pro atm
Reply
#10

i dont think it's PlayerInfo[playerid][gPlayerLogged] are you sure it's not gPlayerLogged[playerid] , check your enum for gPlayerLogged and see if there is a variable max players on it.

Edit: Just looking on your first post the new gPlayerLogged should be in your PlayerInfo Enum.

IE
Код:
enum pInfo
{
 gPlayerLogged,
 gPlayerHealth,
 gPlayerArmour,
etc ,
}
Something along the lines of that
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)