Jump to content
  • 0

Problema /GIVEALLCOINS


SkyLeAs

Question

Problema intalnita (descriere):Cand dau /giveallcoins nu le da coins la jucatori
Ero(area / rile) / warning-(ul / urile):N/a
Liniile de cod / sursa / script-ul(obligatoriu):

CMD:giveallcoins( playerid, params[ ] )
{
if ( !IsPlayerAdmin( playerid ) )
return SendError( playerid, "You need to be logged as RCON admin before use this command!" );

new
sCoins,
Player
;
if ( sscanf( params, "i", sCoins ) )
return SendClientMessage( playerid, COLOR_ULTRARED, "USAGE: {33CCFF}/giveallcoins [Coins]" );

if ( sCoins < 0 )
return SendError( playerid, "Invalid Amount!" );

if ( PlayerInfo[ Player ][ Level ] > PlayerInfo[ playerid ][ Level ] )
return SendError( playerid, "You cannot use this command on this admin" );

format( gsString, sizeof( gsString ), "[RCON] %s has give %d coins to all players.", PlayerName( playerid ), sCoins );
Log_( "log_coins" , "Text" , gsString ) ;

FormatMSG( playerid, COLOR_ABLUE, "You have sent to all players %d coins", sCoins );
format( gsString, sizeof( gsString ), "Administrator %s has give all players %d coins", PlayerName( playerid ), sCoins );

SendClientMessageToAll( COLOR_ABLUE, gsString );
return ( 1 );
}
Imagini / Video (optional):~
Ati incercat sa rezolvati singur?:Da am incercat si nu am reusit sa repar problema
Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

=)) :)) =)) hai ca mi-ai facut ziua mai frumoasa =)) ia de aici

CMD:giveallcoins( playerid, params[ ] )
	{
		if ( !IsPlayerAdmin( playerid ) )
		return SendError( playerid, "You need to be logged as RCON admin before use this command!" );

		new sCoins, Player;
		if ( sscanf( params, "i", sCoins ) )
				return SendClientMessage( playerid, COLOR_ULTRARED, "USAGE: {33CCFF}/giveallcoins [Coins]" );

		if ( sCoins < 0 )
				return SendError( playerid, "Invalid Amount!" );

		if ( PlayerInfo[ Player ][ Level ] > PlayerInfo[ playerid ][ Level ] )
				return SendError( playerid, "You cannot use this command on this admin" );

		
		for(new i=0; i < MAX_PLAYERS; i++)
		{
			PlayerInfo[ i ][ pCoins ] += 1;
			
			format( gsString, sizeof( gsString ), "[RCON] %s has give %d coins to all players.", PlayerName( playerid ), sCoins );
			Log_( "log_coins" , "Text" , gsString ) ;

			FormatMSG( playerid, COLOR_ABLUE, "You have sent to all players %d coins", sCoins );
			format( gsString, sizeof( gsString ), "Administrator %s has give all players %d coins", PlayerName( playerid ), sCoins );

			SendClientMessageToAll( COLOR_ABLUE, gsString );
		}
		return ( 1 );
	}
Link to comment
Share on other sites

  • 0

 

=)) :)) =)) hai ca mi-ai facut ziua mai frumoasa =)) ia de aici





CMD:giveallcoins( playerid, params[ ] )
	{
		if ( !IsPlayerAdmin( playerid ) )
		return SendError( playerid, "You need to be logged as RCON admin before use this command!" );

		new sCoins, Player;
		if ( sscanf( params, "i", sCoins ) )
				return SendClientMessage( playerid, COLOR_ULTRARED, "USAGE: {33CCFF}/giveallcoins [Coins]" );

		if ( sCoins < 0 )
				return SendError( playerid, "Invalid Amount!" );

		if ( PlayerInfo[ Player ][ Level ] > PlayerInfo[ playerid ][ Level ] )
				return SendError( playerid, "You cannot use this command on this admin" );

		
		for(new i=0; i < MAX_PLAYERS; i++)
		{
			PlayerInfo[ i ][ pCoins ] += 1;
			
			format( gsString, sizeof( gsString ), "[RCON] %s has give %d coins to all players.", PlayerName( playerid ), sCoins );
			Log_( "log_coins" , "Text" , gsString ) ;

			FormatMSG( playerid, COLOR_ABLUE, "You have sent to all players %d coins", sCoins );
			format( gsString, sizeof( gsString ), "Administrator %s has give all players %d coins", PlayerName( playerid ), sCoins );

			SendClientMessageToAll( COLOR_ABLUE, gsString );
		}
		return ( 1 );
	}

Nu prea inteleg la ce ai vrut sa te referi.,

Da eroare la pCoins

Edit nu merge la fel..

Edited by JohnnyYz
Link to comment
Share on other sites

  • 0

.... Eu iti voi spune doar asta:

 

la player data sau ce ai pui si un pCoins in caz ca nu ai , sau in fine modifici pCoins cu ce variabila ai tu

 

for(new i=0;i<MAX_PLAYERS;i++)

{

if(!IsPlayerConnected(i))

continue;

PlayerInfo[ i ][ pCoins ] += sCoins;

}

  • Upvote 1
public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

Link to comment
Share on other sites

  • 0

.... Eu iti voi spune doar asta:

 

la player data sau ce ai pui si un pCoins in caz ca nu ai , sau in fine modifici pCoins cu ce variabila ai tu

 

for(new i=0;i<MAX_PLAYERS;i++)

{

if(!IsPlayerConnected(i))

continue;

PlayerInfo[ i ][ pCoins ] += sCoins;

}

Problema a fost rezolvata am uitat sa mai reveni cu edit la topic By AroWnd

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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.