19.08.2012, 19:23
Okay so i tried everything to get this work properly but it's driving me nuts. I want that ''reason'' is saved in //
but i can't manage to get it work i keep getting 006 error and when i use
i got saved under reason number 84 .Any help would be appriciated.Thanks
pawn Код:
PlayerInfo[playerid][pBanReason] = reason;
pawn Код:
format(PlayerInfo[playerid][pBanReason], 128, "%s", reason);
pawn Код:
YCMD:ban(playerid, params[], help)
{
new id, reason[128], str[128], str1[128], str2[128],str3[128] mins, sec, year, month, day;
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin]<=1338)
if (sscanf(params, "ds[128]", id, reason)) SendClientMessage(playerid, COLOR_INFO, "Usage: \"/ban [playerid] [reason]\"");
else if (!IsPlayerConnected(id)) SendClientMessage(playerid, COLOR_RED, "Invalid id");
else
// if (!IsPlayerConnected(id)) SendClientMessage(playerid, COLOR_YELLOW, "Invalid id");
{
gettime(hour, mins, sec);
getdate(year, month, day);
//PlayerInfo[playerid][pBanReason] = reason;
format(str, 128, "Time: %i:%i Date: %i/%i/%i", hour, mins, day, month, year);
SendClientMessage(id, COLOR_RED, str);
format(str1, 128, "Admin: %s Banned: %s Reason: %s", GetName(playerid),GetName(playerid), reason);
SendClientMessageToAll(COLOR_RED,str1);
format(str2, 128, "You have been Banned from the server by Admin: %s Reason: %s",GetName(playerid), reason);
SendClientMessage(id, COLOR_RED, str2);
format(str3, 128, "~r~~h~Banned ~n~~r~");
GameTextForPlayer(id, str3, 6000, 3);
PlayerInfo[playerid][pBanned]= 1;
// format(PlayerInfo[playerid][pBanReason], 128, "%s", reason);
// PlayerInfo[playerid][pBanReason] = reason;
Kick(id);
}
else
{
SendClientMessage(playerid, COLOR_YELLOW, "You are not authorized to use that command!");
}
return 1;
}