Jump to content

Question

Posted

CMD:unban( PARAMS )
{
	if ( PlayerInfo[ playerid ][ Level ] >= 10 || IsPlayerAdmin( playerid ) )
	{
		if ( PlayerInfo[ playerid ][ LoggedIn ] == 1 )
		{
		    new Player;
		    if ( sscanf( params, "s[128]", Player ) ) return SendClientMessage( playerid, COLOR_ULTRARED, "USAGE: {33CCFF}/unban [Player Name]" );

			new file[ 128 ];
			format( file, 128, "/ladmin/users/%s.sav", PlayerName( Player ) );
			if ( udb_Exists( file ) )
			{
				dUserSetINT( PlayerName( Player ) ).( "Banned", 0 );
				PlayerPlaySound( playerid, 1057, 0.0, 0.0, 0.0 );
				FormatMSG( playerid, COLOR_YELLOW, "Account '%s' has been succes fully UnBanned!", PlayerName( Player ) );
			}
			else return SendClientMessage( playerid, COLOR_ULTRARED, "ERROR: This player doesnt have an account" );
		}
		else return SendLogClient( playerid );
	}
	else return SendLevel( playerid, 10 );
	return 1;
}

Cand de exemplu dau /unban [RAS]xxSPEEDYxx imi da: "Command /unban doesn't...etc" dar cand nu exista userul de ex dau: /unban DADadd imi scrie "ERROR: This player doesnt have an account"

Nu inteleg care ii problema la el...am incercat de multe ori in multe feluri sa-l fac dar asta mi sa parut cel mai bun si vad ca nu merge  :undecided:

Fara reclama in semnatura!

5 answers to this question

Recommended Posts

Posted

Schimba

format( file, 128, "/ladmin/users/%s.sav", PlayerName( Player ) );
cu
format( file, 128, "/ladmin/users/%s.sav", udb_encode( Player ) );
Player este deja numele contului, iar udb_encode transforma acel nume in numele filei, care este putin criptata.
dUserSetINT( PlayerName( Player ) ).( "Banned", 0 );
cu
dUserSetINT( udb_encode( Player ) ).( "Banned", 0 );
si
FormatMSG( playerid, COLOR_YELLOW, "Account '%s' has been succes fully UnBanned!", PlayerName( Player ) );
cu
FormatMSG( playerid, COLOR_YELLOW, "Account '%s' has been succes fully UnBanned!", Player );
Si
new Player;
cu
new Player[ MAX_PLAYER_NAME ];

Posted

new Player;

wtf?Undei stringu?

Stii doar ca un jucator banat e un jucatorul care nu e pe server,deci PlayerName( Player ) e o tampenie.

Si unde e playerid si params[] de la CMD?poate ai editat define-ul ..

[pawn]CMD:unban( PARAMS )

{

if ( PlayerInfo[ playerid ][ Level ] >= 10 || IsPlayerAdmin( playerid ) )

{

if ( PlayerInfo[ playerid ][ LoggedIn ] == 1 )

{

    new Player;

    if ( sscanf( params, "s[128]", params[0] ) ) return SendClientMessage( playerid, COLOR_ULTRARED, "USAGE: {33CCFF}/unban [Player Name]" );

new file[ 128 ];

format( file, 128, "/ladmin/users/%s.sav", params[0] );

if ( udb_Exists( file ) )

{

dUserSetINT( params[0] ).( "Banned", 0 );

PlayerPlaySound( playerid, 1057, 0.0, 0.0, 0.0 );

FormatMSG( playerid, COLOR_YELLOW, "Account '%s' has been succes fully UnBanned!", params[0] );

}

else return SendClientMessage( playerid, COLOR_ULTRARED, "ERROR: This player doesnt have an account" );

}

else return SendLogClient( playerid );

}

else return SendLevel( playerid, 10 );

return 1;

}[/pawn]

Posted

Am incercat amandoua metodele dar nici una nu merge...

Tot asa scrie dar acum cand dau orice user care nici nu este in scriptfiles imi da: "ERROR: This player doesnt have an account"

:undecided: ?

Fara reclama in semnatura!

Posted

vezi cum ai comanda /ban construita, daca este in felul urmator : sai ii schimbe levelu -999, trb facuta comanda /unban sa ii restaurfeze levelu (nu am nici o idee cum ar trebui facut ) am bagat si yo o comanda (/unban ) si la fel zicea pt k comanda era conceputa altfel decat aia de /ban si pur si simplu nu vedea jucatorul banat . sper sa te ajute cat de putin ce am zis yo ... bafta

Detroit The Godfather

Adress : gta.xdevil.ro:7777

Se cauta Lideri , helperi, admini ACTIVI !!!

Posted

vezi cum ai comanda /ban construita, daca este in felul urmator : sai ii schimbe levelu -999, trb facuta comanda /unban sa ii restaurfeze levelu (nu am nici o idee cum ar trebui facut ) am bagat si yo o comanda (/unban ) si la fel zicea pt k comanda era conceputa altfel decat aia de /ban si pur si simplu nu vedea jucatorul banat . sper sa te ajute cat de putin ce am zis yo ... bafta

weee aici nu esti pe GF :))

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.