SA-MP Forums Archive
OnPlayerRequestClass and /colorhelp - 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: OnPlayerRequestClass and /colorhelp (/showthread.php?tid=421241)



OnPlayerRequestClass and /colorhelp - PabloDiCostanzo - 08.03.2013

Greetings,


Hellp there, I am trying to add a new class only to players who have permission.

pawn Код:
public OnPlayerRequestClass(playerid,classid)
{
    if(classid == 3 && !IsPlayerAdmin(playerid))
    {
        SendClientMessage(playerid,0xFF9D1CAA,"ERROR: This skin is only to players who have the NG permission.");
        return 0;
    }
    return 1;
}
And when I put this into the
pawn Код:
public OnPlayerRequestClass(playerid, classid)
it says me
Код:
C:\Documents and Settings\Administrador\Escritorio\Gang Wars\gamemodes\GangWars.pwn(444) : error 055: start of function body without function header
C:\Documents and Settings\Administrador\Escritorio\Gang Wars\gamemodes\GangWars.pwn(445) : error 010: invalid function or declaration
C:\Documents and Settings\Administrador\Escritorio\Gang Wars\gamemodes\GangWars.pwn(448) : error 010: invalid function or declaration
C:\Documents and Settings\Administrador\Escritorio\Gang Wars\gamemodes\GangWars.pwn(450) : error 010: invalid function or declaration
And this is the way what I have
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
}

{
    if(classid == 3 && !IsPlayerAdmin(playerid))
    {
        SendClientMessage(playerid,0xFF9D1CAA,"ERROR: This skin is only for players who have the permission.");
        return 0;
    }
    return 1;
}
Thanks, all help will be appreciated.

Regards,
Pablo.


Re: OnPlayerRequestClass and /colorhelp - SilverKiller - 08.03.2013

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    if(classid == 3 && !IsPlayerAdmin(playerid))
    {
        SendClientMessage(playerid,0xFF9D1CAA,"ERROR: This skin is only for players who have the permission.");
        return 0;
    }
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
}
Try, not tested.

(P.S : Please if i'm wrong in something correct me, thanks).


Re: OnPlayerRequestClass and /colorhelp - PabloDiCostanzo - 08.03.2013

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    if(classid == 3 && !IsPlayerAdmin(playerid))
    {
        SendClientMessage(playerid,0xFF9D1CAA,"ERROR: This skin is only for players who have the permission.");
        return 0;
    }
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;

    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
}
And I get this
Код:
C:\Documents and Settings\Administrador\Escritorio\Gang Wars\gamemodes\GangWars.pwn(448) : warning 225: unreachable code



Re: OnPlayerRequestClass and /colorhelp - SilverKiller - 08.03.2013

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    if(classid == 3 && !IsPlayerAdmin(playerid))
    {
        SendClientMessage(playerid,0xFF9D1CAA,"ERROR: This skin is only for players who have the permission.");
        return 0;
    }
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
}



Re: OnPlayerRequestClass and /colorhelp - PabloDiCostanzo - 08.03.2013

+REP

Thanks for help me

-Solved