How to use gTeam?
#1

Hey,
Is it possible to use gTeam so it would work in FSs and NPC scripts?

Example:

My GM
pawn Код:
new gTeam[MAX_PLAYERS];
My FS
pawn Код:
public OnSomeCallback(playerid)
{
gTeam[playerid] = 5;
}
My NPC Script:
pawn Код:
public SomeCallback(playerid)
{
if(gTeam[playerid] == 5)
{
//Do something
}
}
Hope you understood me...
Reply
#2

Quote:
Originally Posted by SiJ
Hey,
Is it possible to use gTeam so it would work in FSs and NPC scripts?

Example:

My GM
pawn Код:
new gTeam[MAX_PLAYERS];
My FS
pawn Код:
public OnSomeCallback(playerid)
{
gTeam[playerid] = 5;
}
My NPC Script:
pawn Код:
public SomeCallback(playerid)
{
if(gTeam[playerid] == 5)
{
//Do something
}
}
Hope you understood me...
Write it with the FS into a file and let the NPC script read it. More questions?
Reply
#3

Or in the original file:
pawn Код:
forward GetgTeam(playerid);
public GetgTeam(playerid)
    return gTeam[playerid];
To get gTeam in the NPC script:
pawn Код:
public SomeCallback(playerid)
{
    if(CallRemoteFunction("GetgTeam", "i", playerid) == 5)
    {
        //Do something
    }
}
Reply
#4

Quote:
Originally Posted by bogeyman_EST
Or in the original file:
pawn Код:
forward GetgTeam(playerid);
public GetgTeam(playerid)
    return gTeam[playerid];
To get gTeam in the NPC script:
pawn Код:
public SomeCallback(playerid)
{
    if(CallRemoteFunction("GetgTeam", "i", playerid) == 5)
    {
        //Do something
    }
}
There is no CallRemoteFunction in NPC scripts..

Quote:
Originally Posted by DeathOnaStick
Quote:
Originally Posted by SiJ
Hey,
Is it possible to use gTeam so it would work in FSs and NPC scripts?

Example:

My GM
pawn Код:
new gTeam[MAX_PLAYERS];
My FS
pawn Код:
public OnSomeCallback(playerid)
{
gTeam[playerid] = 5;
}
My NPC Script:
pawn Код:
public SomeCallback(playerid)
{
if(gTeam[playerid] == 5)
{
//Do something
}
}
Hope you understood me...
Write it with the FS into a file and let the NPC script read it. More questions?
Pretty good idea.. Thanks..
Reply
#5

Quote:
Originally Posted by SiJ
Quote:
Originally Posted by bogeyman_EST
Or in the original file:
pawn Код:
forward GetgTeam(playerid);
public GetgTeam(playerid)
    return gTeam[playerid];
To get gTeam in the NPC script:
pawn Код:
public SomeCallback(playerid)
{
    if(CallRemoteFunction("GetgTeam", "i", playerid) == 5)
    {
        //Do something
    }
}
There is no CallRemoteFunction in NPC scripts..

Quote:
Originally Posted by DeathOnaStick
Quote:
Originally Posted by SiJ
Hey,
Is it possible to use gTeam so it would work in FSs and NPC scripts?

Example:

My GM
pawn Код:
new gTeam[MAX_PLAYERS];
My FS
pawn Код:
public OnSomeCallback(playerid)
{
gTeam[playerid] = 5;
}
My NPC Script:
pawn Код:
public SomeCallback(playerid)
{
if(gTeam[playerid] == 5)
{
//Do something
}
}
Hope you understood me...
Write it with the FS into a file and let the NPC script read it. More questions?
Pretty good idea.. Thanks..
You're welcome =P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)