SA-MP Forums Archive
need a small cmd - 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: need a small cmd (/showthread.php?tid=303499)



need a small cmd - mhamadsaleh - 13.12.2011

Hey i want if someone can help me to make a /unwarn command for luxadmin i will be very thank full if you could help me


Re: need a small cmd - [ABK]Antonio - 13.12.2011

Well...in the warn command there's - AccInfo[warned][Warnings]++;

so...in the unwarn command put AccInfo[warned][Warnings]--;

if(sscanf(params, "us[80]", warned, tmp2)) so warned = the ID typed


Re: need a small cmd - Neo Karls - 13.12.2011

pawn Код:
if(PVar[playerid][pLevel] >= 99999) //level 99999 admin
pawn Код:
CMD:unwarn( playerid, params[ ] )
{
    if(PVar[playerid][pLevel] < 99999) //level 99999 admin
           return SendClientMessage( playerid, -1, "Only admins level 99999 can use this command."
       
    new tempname, temptext[ 128 ]
    if ( sscanf( params, "us[128]", tempname, temptext ) )
        return SendClientMessage( playerid, -1, "Usage: /unwarn <PlayerID> [reason]");

    if ( !IsPlayerConnected( tempname ) )
        return SendClientMessage( playerid, -1, "Player is not connected.");

    SetPVarInt( tempname, "Warnings", GetPVarInt( tempname, "Warnings") - 1 );
   
    new String[ 50 ];
    format( String, sizeof( String ), "Admin %u unwarned you.", playerid );
    SendClientMessage( tempname, -1, String );
   
    format( String, sizeof( String ), "You unwarned player %u for %s.", tempname, temptext );
    SendClientMessage( playerid, -1, String );
    return 1;
}



Re: need a small cmd - Neo Karls - 13.12.2011

Sorry for double posting


Removed!!


Re: need a small cmd - mhamadsaleh - 14.12.2011

Quote:
Originally Posted by [ABK]Antonio
Посмотреть сообщение
Well...in the warn command there's - AccInfo[warned][Warnings]++;

so...in the unwarn command put AccInfo[warned][Warnings]--;

if(sscanf(params, "us[80]", warned, tmp2)) so warned = the ID typed
I dont understand what you meant


Re: need a small cmd - mhamadsaleh - 14.12.2011

Quote:
Originally Posted by Neo Karls
Посмотреть сообщение
pawn Код:
if(PVar[playerid][pLevel] >= 99999) //level 99999 admin
pawn Код:
CMD:unwarn( playerid, params[ ] )
{
    if(PVar[playerid][pLevel] < 99999) //level 99999 admin
           return SendClientMessage( playerid, -1, "Only admins level 99999 can use this command."
       
    new tempname, temptext[ 128 ]
    if ( sscanf( params, "us[128]", tempname, temptext ) )
        return SendClientMessage( playerid, -1, "Usage: /unwarn <PlayerID> [reason]");

    if ( !IsPlayerConnected( tempname ) )
        return SendClientMessage( playerid, -1, "Player is not connected.");

    SetPVarInt( tempname, "Warnings", GetPVarInt( tempname, "Warnings") - 1 );
   
    new String[ 50 ];
    format( String, sizeof( String ), "Admin %u unwarned you.", playerid );
    SendClientMessage( tempname, -1, String );
   
    format( String, sizeof( String ), "You unwarned player %u for %s.", tempname, temptext );
    SendClientMessage( playerid, -1, String );
    return 1;
}
Thank you but i need it for luxadmin


Re: need a small cmd - Kostas' - 14.12.2011

pawn Код:
CMD:unwarn(playerid, params[])
{
    if(AccInfo[playerid][Level] < 2) return SendClientMessage(playerid, COLOR_ERROR, "You are not Admin!");
    new
        tempname,
        temptext[128];
    if(sscanf(params, "us[128]", tempname, temptext)) return SendClientMessage( playerid, -1, "Usage: /unwarn <PlayerID> [reason]");
    if(!IsPlayerConnected(tempname)) return SendClientMessage( playerid, -1, "Player is not connected.");
    SetPVarInt(tempname, "Warnings", GetPVarInt( tempname, "Warnings") - 1 );
    new
        String[50];
    format(String, sizeof(String), "Admin %u unwarned you.", playerid);
    SendClientMessage( tempname, -1, String );
    format(String, sizeof(String), "You unwarned player %u for %s.", tempname, temptext);
    SendClientMessage(playerid, -1, String);
    return 1;
}



Re: need a small cmd - mhamadsaleh - 15.12.2011

Quote:
Originally Posted by Kostas'
Посмотреть сообщение
pawn Код:
CMD:unwarn(playerid, params[])
{
    if(AccInfo[playerid][Level] < 2) return SendClientMessage(playerid, COLOR_ERROR, "You are not Admin!");
    new
        tempname,
        temptext[128];
    if(sscanf(params, "us[128]", tempname, temptext)) return SendClientMessage( playerid, -1, "Usage: /unwarn <PlayerID> [reason]");
    if(!IsPlayerConnected(tempname)) return SendClientMessage( playerid, -1, "Player is not connected.");
    SetPVarInt(tempname, "Warnings", GetPVarInt( tempname, "Warnings") - 1 );
    new
        String[50];
    format(String, sizeof(String), "Admin %u unwarned you.", playerid);
    SendClientMessage( tempname, -1, String );
    format(String, sizeof(String), "You unwarned player %u for %s.", tempname, temptext);
    SendClientMessage(playerid, -1, String);
    return 1;
}
Thank you


Re: need a small cmd - Kostas' - 16.12.2011

Your Welcome!