SA-MP Forums Archive
Help me to fix a problem.. - 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)
+--- Thread: Help me to fix a problem.. (/showthread.php?tid=280396)



Help me to fix a problem.. - ServerScripter - 31.08.2011

hi , i have this ;

pawn Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerToTeamColor(playerid);

    if(gTeam[playerid] == TEAM_STARS)
    {
        SetPlayerPos(playerid, -379.6754,911.4002,9.4913);
        SetPlayerSkin(playerid, 285);
        gTeam[playerid] = TEAM_STARS;
        ResetPlayerWeapons(playerid);
        GivePlayerWeapon(playerid, 31, 300);
        GivePlayerWeapon(playerid, 34, 100);
        SetPlayerColor(playerid,0x00FF00AA);
        GameTextForPlayer(playerid,"Welcome to S.T.A.R HQ sir !",1,1);
    }
return 1;
}
so , i want whene a player choose the skin 285 and spawn with it , Give him Weapons...

but it doesn't give him anything or saying the Message In Game , BTW i have defined the TEAM:

pawn Код:
public SetPlayerTeamFromClass(playerid,classid)
{
    // Set their team number based on the class they selected.
    if(classid == 0) {
        gTeam[playerid] = TEAM_STARS;
    }
}
Note: the First Addclass(balabla) is the Skin 285 so , it must work .. Need Help


Re: Help me to fix a problem.. - ServerScripter - 31.08.2011

Any Idea Guys , any Idea..


Re: Help me to fix a problem.. - Jack_Leslie - 31.08.2011

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    // Set their team number based on the class they selected.
    if(classid == 0)
    {
        gTeam[playerid] = TEAM_STARS;
    }
return 1;
}


Quote:

This forum requires that you wait 120 seconds between posts. Please try again in 23 seconds.




Re: Help me to fix a problem.. - TouR - 31.08.2011

show me your OnPlayerRequestClass


Re: Help me to fix a problem.. - TouR - 31.08.2011

Jack is right, You could also use:

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
     SetPlayerTeamFromClass(playerid,classid);
     return 1;
}



Re: Help me to fix a problem.. - ServerScripter - 31.08.2011

Working Jack thanx all !