SA-MP Forums Archive
[HELP] Need help with /sl - 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] Need help with /sl (/showthread.php?tid=346699)



[HELP] Need help with /sl - Stefand - 29.05.2012

hey,

I made a Show license command.

but when i compile it it gives errors about not difined etc. from OTHER commands.
maybe someone sees the problem.

pawn Код:
command(sl, playerid, params[])
{
    new id, string[128];
    if(sscanf(params, "u", id))
    {
    if(Player[id][DriverLic] == 1){
        format(string, sizeof(string), "------------[LICENSES]------------", GetName(playerid));
        SendClientMessage(id, ORANGE, string);
        format(string, sizeof(string), "Driver: Valid", GetName(playerid));
        SendClientMessage(id, WHITE, string);
        format(string, sizeof(string), "------------[LICENSES]------------", GetName(playerid));
        }
        else
        {
        if(Player[id][DriverLic] == 0)
        {
        format(string, sizeof(string), "------------[LICENSES]------------", GetName(playerid));
        SendClientMessage(id, ORANGE, string);
        format(string, sizeof(string), "Driver: Invalid", GetName(playerid));
        SendClientMessage(id, WHITE, string);
        format(string, sizeof(string), "------------[LICENSES]------------", GetName(playerid));
        SendClientMessage(id, ORANGE, string);
    }
    return 1;
}



Re: [HELP] Need help with /sl - FalconX - 29.05.2012

pawn Код:
CMD:sl( playerid, params[ ] )
{
    new id, string[ 128 ];
    if( sscanf( params, "u", id ) ) return SendClientMessage( playerid, -1, "/sl [playerid]" );
    if( IsPlayerConnected( id ) ) return SendClientMessage( playerid, -1, "ERROR: PLAYER NOT CONNECTED" );
    if( id == INVALID_PLAYER_ID ) return SendClientMessage( playerid, -1, "INvalid player id" );
    if( Player[ id ][ DriverLic ] == 1 )
    {
        SendClientMessage( playerid, ORANGE, "------------[LICENSES]------------" );
        format( string, sizeof( string ), "Driver Name: %s STATUS: Valid", GetName( id ) );
        SendClientMessage( playerid, WHITE, string );
        SendClientMessage( playerid, ORANGE, "------------[LICENSES]------------" );
    }
    else
    {
        SendClientMessage( playerid, ORANGE, "------------[LICENSES]------------" );
        format( string, sizeof( string ), "Driver Name: %s STATUS: Invalid", GetName( id ) );
        SendClientMessage( playerid, WHITE, string );
        SendClientMessage( playerid, ORANGE, "------------[LICENSES]------------" )
    }
    return 1;
}
Hope this helps
_FalconX


Re: [HELP] Need help with /sl - Stefand - 29.05.2012

I'll try it tomorrow.


Re: [HELP] Need help with /sl - Stefand - 31.05.2012

Still not working


Re: [HELP] Need help with /sl - mati233 - 31.05.2012

It would be easier to help you if you show your error logs.


Re: [HELP] Need help with /sl - ViniBorn - 31.05.2012

pawn Код:
CMD:sl( playerid, params[ ] )
{
    new id;
    if( sscanf( params, "r", id ) ) return SendClientMessage( playerid, -1, "/sl [playerid]" );
    if( IsPlayerConnected( id ) ) return SendClientMessage( playerid, -1, "ERROR: PLAYER NOT CONNECTED" );
    if( id == INVALID_PLAYER_ID ) return SendClientMessage( playerid, -1, "Invalid player id" );

    new VBString[ 64 ];
    if( Player[ playerid ][ DriverLic ] == 1 )
        format( VBString, sizeof( VBString), "Driver Name: %s STATUS: Valid", GetName( playerid ) );
    else
        format( VBString, sizeof( VBString), "Driver Name: %s STATUS: Invalid", GetName( playerid ) );

    SendClientMessage( id, ORANGE, "------------[LICENSES]------------" );        
    SendClientMessage( id, WHITE, VBString);
    SendClientMessage( id, ORANGE, "------------[LICENSES]------------" );
    return 1;
}