This admin command crashes the server.
#1

Can anyone find what's wrong with this cmd? It's a command from our server.

Quote:

CMD:tempban(playerid,parmas[])
{
if (PInfo[playerid][Admin] < 3) return SendClientMessage(playerid, RED,"[ERROR]: {FFFFFF}You do not have the privilleges to perform this command.");
new tid,du,res[150],ppp[50];
if(sscanf(parmas,"uis",tid,du,res) || isnull(parmas))return SendClientMessage(playerid,TOMATO,"[USAGE]: {FFFFFF}/tempban (OkayerID) (Days) (Reason)");
if(!IsPlayerConnected(tid))return SendClientMessage(playerid,-1,"{ff6666}The Player you requested is not connected.");
new adminname[MAX_PLAYER_NAME],targetn[MAX_PLAYER_NAME];
GetPlayerName(playerid,adminname,sizeof(adminname) );
new exp=gettime()+(60*60*24*du);
GetPlayerIp(tid,ppp,sizeof(ppp));
new INI:File = INI_Open(UserBanPath(tid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Banexp",exp);
INI_WriteInt(File,"BanPerm",0);
INI_WriteString(File,"BanAdmin",adminname);
INI_WriteString(File,"Reason",res);
INI_WriteString(File,"IP",ppp);
INI_Close(File);
GetPlayerName(tid,targetn,sizeof(targetn));
new INI:iFile = INI_Open(UserIPPath(tid));
INI_SetTag(iFile,"data");
INI_WriteInt(iFile,"Banexp",exp);
INI_WriteInt(iFile,"BanPerm",0);
INI_WriteString(iFile,"BanPlayer",targetn);
INI_WriteString(iFile,"BanAdmin",adminname);
INI_WriteString(iFile,"Reason",res);
INI_Close(iFile);
new File:logg=fopen("BannedPlayers.txt",io_append);
fwrite(logg, targetn);
fwrite(logg,"\n");
fclose(logg);
new string[500];
SendClientMessage(playerid, TOMATO,"[TEMPBAN]: {FFFFFF}The selected account has been temp banned from the database.");
format(string,sizeof(string),"[ADMIN ACTION]: {FFFFFF}Administrator %s has banned %s(%d) from the server for %i days. Reason: %s.",GetName(playerid), GetName(tid),tid,du,res);
SendClientMessageToAll(COLOR_ADMIN,string);
SetTimerEx("KickPlayer",100,false,"i",tid);
return 1;
}

Reply


Messages In This Thread
This admin command crashes the server. - by GamezCEO - 20.02.2018, 16:17
Re: This admin command crashes the server. - by iKarim - 20.02.2018, 16:21
Re: This admin command crashes the server. - by GamezCEO - 20.02.2018, 16:37
Re: This admin command crashes the server. - by Mugala - 20.02.2018, 16:53
Re: This admin command crashes the server. - by Logic_ - 21.02.2018, 05:48
Re: This admin command crashes the server. - by RogueDrifter - 21.02.2018, 06:25

Forum Jump:


Users browsing this thread: 4 Guest(s)