Bus System dosnt work..
#1

Hello guys..
I am using [NPC]Bus System Filterscript that is made by Adil but the NPC drivers spawns and then gets dissconnected please help me! I was told that the problem is in here
pawn Код:
public OnPlayerSpawn(playerid)
{
   
    SetRealMoney(playerid, ScriptMoney[playerid]);
    new pName[MAX_PLAYER_NAME];
    new string[128];
    InitLockDoors(playerid);
    if(IsPlayerNPC(playerid)) return 1;
    STDPlayer[playerid] = 0;
    gTeam[playerid] = PlayerInfo[playerid][pTeam]; //Set the Team
    if (gTeam[playerid] == 4) //medic / criminal reset team
    {
        gTeam[playerid] = 3;
    }
    if(gPlayerLogged[playerid] == 0 && IsPlayerNPC(playerid))
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "** This server requires a Login BEFORE spawn (Kicked) **");
        Kick(playerid);
    }
and that i should add
pawn Код:
&& IsPlayerNPC(playerid)
to this line
pawn Код:
if(gPlayerLogged[playerid] == 0)
to make it
pawn Код:
if(gPlayerLogged[playerid] == 0 && IsPlayerNPC(playerid))
But even after i changed it the NPC is still dissconnecting so i really need help with this please!
Reply
#2

Try to change the line for:

pawn Код:
if(gPlayerLogged[playerid] == 0 && !IsPlayerNPC(playerid))
Reply
#3

Remove the && !IsPlayerNPC from there and add this under OnPlayerConnect
pawn Код:
public OnPlayerConnect(playerid)
{
    if(IsPlayerNPC(playerid)) return gPlayerLogged[playerid] = 1;
    return 1;
}
Reply
#4

didnt work
Reply
#5

pawn Код:
public OnPlayerSpawn(playerid)
{
   
    SetRealMoney(playerid, ScriptMoney[playerid]);
    new pName[MAX_PLAYER_NAME];
    new string[128];
    InitLockDoors(playerid);
    STDPlayer[playerid] = 0;
    gTeam[playerid] = PlayerInfo[playerid][pTeam]; //Set the Team
    if (gTeam[playerid] == 4) //medic / criminal reset team
    {
        gTeam[playerid] = 3;
    }
    if(gPlayerLogged[playerid] == 0)
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "** This server requires a Login BEFORE spawn (Kicked) **");
        Kick(playerid);
    }
pawn Код:
public OnPlayerConnect(playerid)
{
    if(IsPlayerNPC(playerid)) return gPlayerLogged[playerid] = 1;
    return 1;
}
That doesn't work?
Reply
#6

pawn Код:
public OnPlayerSpawn(playerid)
{
    SetRealMoney(playerid, ScriptMoney[playerid]);
    new pName[MAX_PLAYER_NAME];
    new string[128];
    InitLockDoors(playerid);
    STDPlayer[playerid] = 0;
    gTeam[playerid] = PlayerInfo[playerid][pTeam]; //Set the Team
    if (gTeam[playerid] == 4) //medic / criminal reset team
    {
        gTeam[playerid] = 3;
    }
    if(gPlayerLogged[playerid] == 0 && !IsPlayerNPC(playerid))
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "** This server requires a Login BEFORE spawn (Kicked) **");
        Kick(playerid);
    }
This should work, but it your own code should've worked in the first place.
Interesting... Try my code.
Reply
#7

Quote:
Originally Posted by willsuckformoney
Посмотреть сообщение
pawn Код:
public OnPlayerSpawn(playerid)
{
   
    SetRealMoney(playerid, ScriptMoney[playerid]);
    new pName[MAX_PLAYER_NAME];
    new string[128];
    InitLockDoors(playerid);
    STDPlayer[playerid] = 0;
    gTeam[playerid] = PlayerInfo[playerid][pTeam]; //Set the Team
    if (gTeam[playerid] == 4) //medic / criminal reset team
    {
        gTeam[playerid] = 3;
    }
    if(gPlayerLogged[playerid] == 0)
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "** This server requires a Login BEFORE spawn (Kicked) **");
        Kick(playerid);
    }
pawn Код:
public OnPlayerConnect(playerid)
{
    if(IsPlayerNPC(playerid)) return gPlayerLogged[playerid] = 1;
    return 1;
}
That doesn't work?
pawno crashes
Reply
#8

You forgot to close the last braket on OnPlayerSpawn...
Reply
#9

This is how it was before
pawn Код:
public OnPlayerConnect(playerid)
{




    // all saints hostpital
    RemoveBuildingForPlayer(playerid, 1410, 2487.3984, -1688.1016, 13.2813, 0.25);
    RemoveBuildingForPlayer(player
and this is what a changed it to
pawn Код:
public OnPlayerConnect(playerid)
{
    if(IsPlayerNPC(playerid)) return gPlayerLogged[playerid] = 1;
    return 1;
}




    // all saints hostpital
    RemoveBuildingForPlayer(playerid, 1410, 2487.3984, -1688.1016, 13.2813, 0.25);
    RemoveBuildingForPlayer(player
Reply
#10

pawn Код:
public OnPlayerSpawn(playerid)
{
    SetRealMoney(playerid, ScriptMoney[playerid]);
    new pName[MAX_PLAYER_NAME];
    new string[128];
    InitLockDoors(playerid);
    STDPlayer[playerid] = 0;
    gTeam[playerid] = PlayerInfo[playerid][pTeam]; //Set the Team
    if (gTeam[playerid] == 4) //medic / criminal reset team
    {
        gTeam[playerid] = 3;
    }
    if(gPlayerLogged[playerid] == 0 && !IsPlayerNPC(playerid))
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "** This server requires a Login BEFORE spawn (Kicked) **");
        Kick(playerid);
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)