Hali all.
Csináltam egy olyan kirúg parancsot,hogy egy fájlba (dini) lementi az adatokat.
Ki a banolt
Ki banolta
Mikor banolta
és azt h Banolva
Nos ezzel probléma akadt!
Kód:
#include a_samp
#include zcmd
#include dini
#include sscanf
#include IsPlayerLAdmin
new kirugott[MAX_PLAYER_NAME];
new file[68];
CMD:kirug(playerid, params[])
{
if(IsPlayerLAdmin(playerid))
{
new giveplayerid, indok[128], string[128], name[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME];
if(sscanf(params, \"us\", giveplayerid, indok)) return SendClientMessage(playerid, 0xFF0000FF, \"Használat: /kirug [playerid] [indok]\");
if(!IsPlayerConnected(giveplayerid) || 0 > giveplayerid || giveplayerid > MAX_PLAYERS) return SendClientMessage(playerid, 0xFF0000FF, \"Hiba: Nincs ilyen játékos!\");
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(giveplayerid, name2, sizeof(name2));
format(string, sizeof string, \"{ff0000}[ADMIN,%s]:{b3d5b2} Kirúgta %s -t {00bbff}[ Indok: %s]\", name, name2, indok);
SendClientMessageToAll(0xB3D5B2AA,string);
Ban(giveplayerid);
new year,month,day,hour,minute,sec;
getdate(year,month,day);
gettime(hour,minute,sec);
format(file,sizeof(file),\"Kirugva/%s.ini\",kirugott(giveplayerid), kirugta(playerid));
if(!fexist(file)){
dini_Create(file);
format(str,sizeof(str),\"%d,%02d,%02d %02d:%02d:%02d\",year,month,day,hour,minute,sec);
dini_Set(file,\"Név\",kirugott(giveplayerid));
dini_Set(file,\"Kirúgta:\",kirugta(playerid));
dini_Set(file,\"Kirúgva\",str);
}
else
{
SendClientMessage(playerid, hiba, \"Nem vagy admin!\");
}
return 1;
}
Hiba:
E:\\Documents and Settings\\Krisz\\Asztal\\[R]endõr [A]cademy\\pawno\\include\\IsPlayerLAdmin.inc(18) : warning 219: local variable \"file\" shadows a variable at a preceding level
E:\\Documents and Settings\\Krisz\\Asztal\\[R]endõr [A]cademy\\filterscripts\\kirugas.pwn(25) : error 012: invalid function call, not a valid address
E:\\Documents and Settings\\Krisz\\Asztal\\[R]endõr [A]cademy\\filterscripts\\kirugas.pwn(25) : warning 215: expression has no effect
E:\\Documents and Settings\\Krisz\\Asztal\\[R]endõr [A]cademy\\filterscripts\\kirugas.pwn(25) : error 001: expected token: \";\", but found \")\"
E:\\Documents and Settings\\Krisz\\Asztal\\[R]endõr [A]cademy\\filterscripts\\kirugas.pwn(25) : error 029: invalid expression, assumed zero
E:\\Documents and Settings\\Krisz\\Asztal\\[R]endõr [A]cademy\\filterscripts\\kirugas.pwn(25) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.