13.11.2013, 15:52
Can you please help me make a /minuscash and /minusscore out of this script below?
Код:
COMMAND:givecash(playerid, params[]) { if(PlayerInfo[playerid][AdminLevel] >= LEVEL_givecash) { new player, amount; if(sscanf(params, "ui", player, amount)) { GameTextForPlayer(playerid, "~g~/givecash ~w~<id/name> <amount>", 3000, 3); return 1; } if(IsPlayerConnected(player) && player != INVALID_PLAYER_ID) { new string[128]; format(string,sizeof(string),"%s(%d) has given you cash of $%d", GetName(playerid), playerid, amount); SendClientMessage(player, GREY, string); format(string,sizeof(string),"You gave %s(%d) a cash of $%d", GetName(player), player, amount); SendClientMessage(playerid, GREY, string); GivePlayerMoney(player, amount); } else { GameTextForPlayer(playerid, "~r~Player is unavailable", 3000, 3); } } else { SendClientMessage(playerid, RED, NO_PERM); } return 1; }
Код:
COMMAND:givescore(playerid,params[]) { if(PlayerInfo[playerid][AdminLevel] >= LEVEL_givescore) { new player, amount; if(sscanf(params, "ui", player, amount)) { GameTextForPlayer(playerid, "~g~/givescore ~w~<name/id> <score>", 3000, 3); return 1; } if(IsPlayerConnected(player) && player != INVALID_PLAYER_ID) { new string[128]; if(player != playerid) { format(string,sizeof(string),"%s(%d) has given you a score of %d", GetName(playerid), playerid,amount); SendClientMessage(player,GREY,string); format(string,sizeof(string),"You gave %s(%d) a score of %d",GetName(player), player); SendClientMessage(playerid,GREY,string); } else { format(string,sizeof(string),"You give yourself a score of %d",amount); SendClientMessage(playerid,GREY,string); } SetPlayerScore(player, GetPlayerScore(player)+ amount); } else { GameTextForPlayer(playerid, "~r~player is unavailable", 3000, 3); } } else { SendClientMessage(playerid, RED, NO_PERM); } UpdateMySQLScore(playerid); return 1; }