17.02.2015, 17:49
Hello everyone Can to help mee with a command ?
This is the command when i Use /ban 0 1 Test
He send mee the message of command not exist
Help mee please
PHP Code:
CMD:ban(playerid,parmas[])
{
if(pInfo[playerid][pLogged] == 1)
{
if(pInfo[playerid][pAdminLevel] >= 1)
{
new tid,du,res[150],ppp[50];
if(sscanf(parmas,"uis[150]",tid,du,res) || isnull(parmas))return SendClientMessage(playerid,-1,"{ff0000}Wrong Usage || Correct Usage : /ban id duration(In Days) Reason");
if(!IsPlayerConnected(tid))return SendClientMessage(playerid,-1,"{ff6666}The Player you requested is not connected.");
new banmt[300],banma[300],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);
format(banmt,sizeof(banmt),"{ff0000}Admin %s has banned you for %i days due to %s",adminname,du,res);
format(banma,sizeof(banma),"{ff0000}Admin %s has banned %s for %i days due to %s",adminname,targetn,du,res);
SendClientMessage(tid,-1,banmt);
SendClientMessageToAll(-1,banma);
SetTimerEx("KickPlayer",100,false,"i",tid);
}
else {
SendClientMessage(playerid,-1,""chat""COL_LIGHTBLUE" You do not have the right admin permissions for this command!");
}
}
else if(pInfo[playerid][pLogged] == 0)
{
SendClientMessage(playerid,-1,""chat""COL_LIGHTBLUE" Nice try u fucking fag gay!");
printf("%s has been kicked for trying to use a command without being logged in!", PlayerName(playerid));
Kick(playerid);
}
return 1;
}
He send mee the message of command not exist
Help mee please