I need /givecash command!
#6

Код:
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

dcmd(setcash,7,cmdtext);

dcmd_setcash(playerid,params[]) {
	if(PlayerInfo[playerid][Level] >= 3) {
	  new tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index);
	  if(!strlen(tmp) || !strlen(tmp2) || !IsNumeric(tmp2)) return SendClientMessage(playerid, red, "USAGE: /setcash [playerid] [amount]");
		new player1 = strval(tmp), cash = strval(tmp2), string[128];
		if(PlayerInfo[player1][Level] == ServerInfo[MaxAdminLevel] && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid,red,"ERROR: You cannot use this command on this admin");
    if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) {
			CMDMessageToAdmins(playerid,"SETCASH");
			format(string, sizeof(string), "You have set \"%s's\" cash to '$%d", pName(player1), cash); SendClientMessage(playerid,blue,string);
			if(player1 != playerid) { format(string,sizeof(string),"Administrator \"%s\" has set your cash to '$%d'", pName(playerid), cash); SendClientMessage(player1,blue,string); }
			ResetPlayerMoney(player1);
  			return GivePlayerMoney(player1, cash);
	  } else return SendClientMessage(playerid,red,"ERROR: Player is not connected");
	} else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
}
Reply


Messages In This Thread
I need /givecash command! - by zerolight - 07.07.2009, 23:59
Re: I need /givecash command! - by ACERS - 08.07.2009, 00:02
Re: I need /givecash command! - by Correlli - 08.07.2009, 00:05
Re: I need /givecash command! - by Rhemsis - 08.07.2009, 04:30
Re: I need /givecash command! - by StrickenKid - 08.07.2009, 04:49
Re: I need /givecash command! - by troy52192 - 08.07.2009, 05:50
Re: I need /givecash command! - by Correlli - 08.07.2009, 05:51
Re: I need /givecash command! - by zerolight - 08.07.2009, 23:18
Re: I need /givecash command! - by Correlli - 08.07.2009, 23:29
Re: I need /givecash command! - by zerolight - 09.07.2009, 12:00

Forum Jump:


Users browsing this thread: 1 Guest(s)