Jump to content
  • 0

Coins


[Funky]Anakin

Question

Salut sa-mp.ro ! Am o problema la comanda /setcoins .

Nu merge sa il setez coins !

[pawn]dcmd_setcoins(playerid, params[])

{

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

    {

if(sscanf(params, "ud", giveplayerid, amount)) SendClientMessage(playerid, orange, "USAGE : /setcoins [playerid] [amount]");

else if(giveplayerid == INVALID_PLAYER_ID) SendClientMessage(playerid, red, "ERROR : That player is not connected!");

else

{

new string[156],file[100],Name[MAX_PLAYER_NAME],Ip[16],name[MAX_PLAYER_NAME]; GetPlayerName(giveplayerid, name, sizeof(name));GetPlayerName(playerid,Name,sizeof(Name)); GetPlayerIp(playerid,Ip,sizeof(Ip)); format(file,sizeof(file),PlayerFile,Name);

    format(string, sizeof(string), "You have succesfully setted %s coins to %d!", name, amount);

        SendClientMessage(playerid, Limegreen, string);

format(string, sizeof(string), "Admin %s has setted your coins to %d!", Name, amount);

        SendClientMessage(giveplayerid, Limegreen, string);

pInfo[giveplayerid][Coins] = amount;

dini_IntSet(file,"Coins", pInfo[giveplayerid][Coins]);

}

}

else

{

SendClientMessage(playerid, red, "ERROR : Only admins can use that command!");

}

return 1;

}[/pawn]

idiots.png
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Incearca acuma xD

dcmd_setcoins(playerid, params[])
{
	if( PlayerInfo[ playerid ][ Level ] < 10 || !IsPlayerAdmin( playerid ) || PlayerInfo[ playerid ][ Owner ] == 0 )
		return SendClientMessage( playerid, red, "ERROR : Only admins can use that command!" );

	if( sscanf( params, "ud", giveplayerid, amount ) ) 
		return SendClientMessage( playerid, orange, "USAGE : /setcoins [playerid] [amount]" );

	if( giveplayerid == INVALID_PLAYER_ID ) 
		return SendClientMessage( playerid, red, "ERROR : That player is not connected!" );

	new string[ 156 ], file[ 100 ], Name[ MAX_PLAYER_NAME ], Ip[ 16 ], name[ MAX_PLAYER_NAME ]; 
	GetPlayerName( giveplayerid, name, sizeof( name ) );
	GetPlayerName( playerid, Name, sizeof( Name ) ); 
	GetPlayerIp( playerid, Ip, sizeof( Ip ) ); 
	format( file, sizeof( file ), PlayerFile, Name );
	format( string, sizeof( string ), "You have succesfully setted %s coins to %d!", name, amount );
	SendClientMessage( playerid, Limegreen, string );
	format( string, sizeof( string ), "Admin %s has setted your coins to %d!", Name, amount );
	SendClientMessage( giveplayerid, Limegreen, string );
	pInfo[ giveplayerid ][ Coins ] = amount;
	dini_IntSet( file, "Coins", pInfo[ giveplayerid ][ Coins ] );

	return 1;
}


F*ck everybody who want and who try to judge me for who I am, b*star*s !

 

 

Link to comment
Share on other sites

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.