10.05.2011, 23:21
i got this little /fine command, but the problem is whenever i /fine someone, they ask me the reaso after it, i was thinking to edit it and add something so i can fine and people can also see the reason
Example : USAGE: /fine [playerid] [amount] [reason]
Right now its : USAGEL /fine [playerid] [amount]
Here is my code
Example : USAGE: /fine [playerid] [amount] [reason]
Right now its : USAGEL /fine [playerid] [amount]
Here is my code
pawn Код:
if(strcmp(cmd, "/fine", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /fine [playerid/PartOfName] [amount]");
return 1;
}
new playa;
new money;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
money = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1337)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
SafeResetPlayerMoney(playa);
SafeGivePlayerMoney(playa, -money);
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, 256, "AdmCmd: %s has Fined %s [Amount: $%d]", sendername,giveplayer,money);
SendClientMessageToAll(COLOR_LIGHTRED,string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
}
}
return 1;
}