OnPlayerRequestClass and /colorhelp
#1

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.
Reply
#2

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).
Reply
#3

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
Reply
#4

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;
}
Reply
#5

+REP

Thanks for help me

-Solved
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)