SA-MP Forums Archive
[Help] Pulling something from my GM to FS - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Help] Pulling something from my GM to FS (/showthread.php?tid=84917)



[Help] Pulling something from my GM to FS - Ace_Menace - 04.07.2009

Okay so In my gm I have

pawn Код:
PlayerInfo
And what I want to do is use a filterscript, that has to have that in it.
How do I do that?

Код:
(33) : warning 217: loose indentation
(43) : error 017: undefined symbol "PlayerInfo"
(43) : warning 215: expression has no effect
(43) : error 001: expected token: ";", but found "]"
(43) : error 029: invalid expression, assumed zero
(43) : fatal error 107: too many error messages on one
pawn Код:
#include <a_samp>
#define FILTERSCRIPT
#if defined FILTERSCRIPT
forward IsAGangCar(carid);
public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#else
#endif
public OnPlayerConnect(playerid)
{
    AddStaticVehicle(451,2473.3513,-1694.6342,13.2228,359.2836,7,7);// 269
    AddStaticVehicle(451,2489.6106,-1682.7407,13.0427,87.9387,7,7);// 270
    return 1;
}

public IsAGangCar(carid)
{
if(carid >= 269 && carid <= 270)
    {
        return 1;
    }
(33)**  return 0;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
      new newcar = GetPlayerVehicleID(playerid);
      if(IsAGangCar(newcar))
      {
(43)****          if(PlayerInfo[playerid][pLeader] == 15||PlayerInfo[playerid][pMember] == 15) { }
          else {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_GREY,"You don't have keys to this vehicle.");}
        }
    }
    return 1;
}



Re: [Help] Pulling something from my GM to FS - Grim_ - 04.07.2009

You have to define PlayerInfo and put the other info into it, for example:
pawn Код:
enum Info
{
  Leader,
  Member,
};

new PlayerInfo[MAX_PLAYERS][Info];



Re: [Help] Pulling something from my GM to FS - Ace_Menace - 04.07.2009

Okay, so if we have

pawn Код:
if(PlayerInfo[playerid][pMember] == 15)
Will it check the GM for that still, even if it's redefined?


Re: [Help] Pulling something from my GM to FS - Grim_ - 04.07.2009

Not necessarily. If you want functions from another source to work inside your gamemode, you'd have to add a include. If you want to make it a filterscript, you'd have to re-add your register system and everything to do with that gang/faction.


Re: [Help] Pulling something from my GM to FS - Ace_Menace - 04.07.2009

Okay, thanks.

I got it compiled, I will see what I can do with it from here.


Re: [Help] Pulling something from my GM to FS - Ignas1337 - 04.07.2009

you can also use mysql to save the values from gm and the nload the values in fs.