[HELP] Need help with /sl
#1

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

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

I'll try it tomorrow.
Reply
#4

Still not working
Reply
#5

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)