OnPlayerSpawn Help
#1

Why doesnt this work. When I am unlogged in I still dont get kicked and when logged in i dont get the weapons
Quote:

// ----------------------------------------------------------------------------------------------------------------------//

public OnPlayerSpawn(playerid)
{
if (gPlayerLogged[playerid] = 0)
{
Kick(playerid);
return 1;
}
else if (gPlayerLogged[playerid] != 0)
{
GivePlayerWeapon(playerid, 24, 500);
GivePlayerWeapon(playerid, 27, 500);
GivePlayerWeapon(playerid, 29, 500);
GivePlayerWeapon(playerid, 31, 500);
GivePlayerWeapon(playerid, 34, 500);
SetPlayerHealth(playerid, 100.0);
SetPlayerArmour(playerid, 100.0);
SetPlayerToTeamColor(playerid);
}

if(gTeam[playerid] == TEAM_GROVE)
{
SetPlayerTeam(playerid, 1 );
}
if(gTeam[playerid] == TEAM_BALLA)
{
SetPlayerTeam(playerid, 2 );
}

Textdraw0 = TextDrawCreate(455.000000,6.000000,"Bubka3's GangWars");
TextDrawAlignment(Textdraw0,0);
TextDrawBackgroundColor(Textdraw0,0x000000ff);
TextDrawFont(Textdraw0,3);
TextDrawLetterSize(Textdraw0,0.499999,1.500000);
TextDrawColor(Textdraw0,0xffffffff);
TextDrawSetOutline(Textdraw0,1);
TextDrawSetProportional(Textdraw0,1);
TextDrawSetShadow(Textdraw0,7);

for(new i=0; i<MAX_PLAYERS; i++ )
{
TextDrawShowForPlayer( i , Textdraw0);
}

SetPlayerMapIcon( playerid, 0, 2529.4207,-1667.4916,15.1687, 62, 0 );
SetPlayerMapIcon( playerid, 1, 2277.2932,-1644.9403,15.2888, 59, 0 );

SetVehicleParamsForPlayer(GroveVeh,playerid,1,0);
SetVehicleParamsForPlayer(BallasVeh,playerid,1,0);

return 1;
}

// ----------------------------------------------------------------------------------------------------------------------//

Reply
#2

when player logs do you have
pawn Код:
gPlayerLogged[playerid]=1;
?
and
this
pawn Код:
if (gPlayerLogged[playerid] = 0)
    {
      Kick(playerid);
     return 1;
    }
is like this
pawn Код:
if (gPlayerLogged[playerid] == 0)
    {
      Kick(playerid);
     return 1;
    }

Reply
#3

Thanks, i need to add the 1 code and fixed if and else if, all working, thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)