View Single Post
Old 04/11/2014, 09:26 PM   #28
RedSamp
Big Clucker
 
Join Date: Nov 2014
Posts: 78
Reputation: 2
Thumbs up Re: Pedidos de Script

Hola a todos,quisiera que me ayudaran a crear un comando para dar estas monedas,con estas variables,aca les dejo un comando para que se guien,y quiero que cuando uno le de monedas a alguien,que salgo en el chat y que todos los vean,que salga asi:
ejemplo):RedSamp le dio 1000 monedas a Jugador,Razon: Hola como estas?
Entienden?quiero que el comando sea asi :/darmonedas [ID/jugador] [Cantidad de Monedas] [Razon]
y que todo eso sea visible por los players.saludos
Code:
Code:
CMD:setcash(playerid, params[])
{
	//check admin level
	if(! CheckAdmin(playerid, 3)) return 1;

	//split params
	new player1, cash;
	if(CheckSplit(params, "ud", player1, cash))
	{
		return	SendClientMessage(playerid, LIGHTBLUE, "[ USAGE: /setcash (player<name/id>) (amount) ]") &&
				SendClientMessage(playerid, LIGHTBLUE2, "[ FUNCTION: Will set cash of the specified player. ]");
	}

  	//check if player is connected
	if(! CheckConnect(playerid, player1)) return 1;

	//check player1 immunity
	if(! CheckImmune(playerid, player1)) return 1;

	new string[256];
	SendCommandMessageToAdmins(playerid,"Setcash");
	format(string, sizeof(string), "[ ADMIN: You have set '%s's' cash to '$%d'. ]", GetPlayerNameEx(player1), cash);
	SendClientMessage(playerid,BlueMsg,string);
	PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
	if(player1 != playerid)
	{
		format(string,sizeof(string),"[ Administrator '%s' has set your cash to '$%d'. ]", GetPlayerNameEx(playerid), cash);
		SendClientMessage(player1,blue,string);
		PlayerPlaySound(player1,1057,0.0,0.0,0.0);
	}
	ResetPlayerMoney(player1);
	GivePlayerMoney(player1, cash);
	return 1;
}
RedSamp is offline