02.07.2013, 22:32
(
Последний раз редактировалось Akcent_Voltaj; 03.07.2013 в 00:59.
)
can someone help me make this dcmd intro strcmp??please I tried but it didn't work..help me ..PLZ
PHP код:
dcmd_banp(playerid,params[]) //i edited is it good?
{
new player1;
new reason[64];
if (sscanf(params, "us[128]", player1, reason))
{
SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: /banp [playerid/PartOfName] [motiv]");
return 1;
}
if(!IsPlayerConnected(player1))
{
SendClientMessage(playerid, COLOR_RED, "This Player is not connected.");
return 1;
}
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,COLOR_RED, "You must be administrator level 1 to use that command!");
new str[128];
new giveplayerid;
new giveplayer[MAX_PLAYER_NAME];
new sendername[MAX_PLAYER_NAME];
new targetlevel = PlayerInfo[giveplayerid][pAdmin];
new playerlevel = PlayerInfo[playerid][pAdmin];
if(targetlevel > playerlevel) return SendClientMessage(playerid, COLOR_GREY, "* Are functie mai mare decat tine !");
if(FindIP(reason))
{
new advertiser[MAX_PLAYER_NAME];
GetPlayerName(playerid, advertiser, sizeof(advertiser));
SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
SendClientMessage(playerid, COLOR_WHITE,"Dute in pula mea de muist sa-ti moara neamu de tigan borat,cretin marsh !");
format(str, sizeof(str), "* %s a primit Ban la BOT, motiv: Reclama Server!",advertiser);
SendClientMessageToAll(COLOR_RED, str);
BanLog(str);
Ban(playerid);
return 1;
}
new Player[200], string[128];
format(Player,sizeof(Player),"/NameBan/%s.txt",GetPlayeridName(player1));
if(!dini_Exists(Player))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string,sizeof(string),"Playername {FF8200}%s {FFFFFF} is added to the ban list.", GetPlayeridName(player1));
SendClientMessage(playerid,COLOR_WHITE,string);
new year, month,day;
getdate(year, month, day);
new Hour, Min, Sec;
gettime(Hour, Min, Sec);
format(string, sizeof(string), "AdmCmd: %s a primit Ban Permanent de la %s, Motiv: %s!",GetPlayeridName(player1), sendername,reason);
SendClientMessageToAll(COLOR_RED, string);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string, sizeof(string), "AdmCmd: %s a primit Ban Permanent pe data de : | %d/%d/%d | ora | %02d:%02d:%02d | ",GetPlayeridName(player1),day,month,year,Hour, Min, Sec);
SendClientMessageToAll(COLOR_RED, string);
format(string, sizeof(string), "[%d/%d/%d](%d:%d:%d) AdmCmd: %s a primit Ban Permanent de la %s, Motiv: %s!",d,m,y,h,mi,s,giveplayer, sendername,reason);
BanLog(string);
if(giveplayerid == playerid)
{
SendClientMessage(playerid, COLOR_RED,"AdmCmd: Nu iti poti da ban singur.");
return 1;
}
new pName[MAX_PLAYER_NAME];
GetPlayerName(giveplayerid,pName,MAX_PLAYER_NAME);
if(strcmp(pName,"Mircea") == 0) return SendClientMessage(playerid,-1,"{E60000}ERROR: Nu poti da Ban la Mircea!");
if(strcmp(pName,"Wolf") == 0) return SendClientMessage(playerid,-1,"{E60000}ERROR: Nu poti da Ban la Wolf!");
new playersip[256];
GetPlayerIp(giveplayerid,playersip, sizeof(playersip));
SendClientMessage(giveplayerid,COLOR_BLUE,"|___________[BAN INFO]___________|");
format(string, sizeof(string), "Numele tau este: %s.",GetPlayeridName(player1));
SendClientMessage(giveplayerid, COLOR_WHITE, string);
format(string, sizeof(string), "IP-ul tau este: %s.",playersip);
SendClientMessage(giveplayerid, COLOR_WHITE, string);
format(string, sizeof(string), "Ai fost banat de: %s.",sendername);
SendClientMessage(giveplayerid, COLOR_WHITE, string);
format(string, sizeof(string), "Ai fost banat pentru urmatorul motiv: %s.",reason);
SendClientMessage(giveplayerid, COLOR_WHITE, string);
format(string, sizeof(string), "Ai fost banat pe data de: %d/%d/%d",day,month,year);
SendClientMessage(giveplayerid, COLOR_WHITE, string);
SendClientMessage(giveplayerid,COLOR_BLUE,"|___________[BAN INFO]___________|");
SendClientMessage(giveplayerid,COLOR_WHITE,"[BAN INFO]: Poti face o cerere de unban pe forumul nostru.Forumul este 'www.unionzonerpg.eu/' forum Succes !");
SendClientMessage(giveplayerid,COLOR_WHITE,"[HINT]: Te sfatuim sa faci o poza la aceste informatii,si sa o postezi cand faci cerere unban.Apasa F8 pentru a face poza !");
Kick(player1);
dini_Create(Player);
}
else
{
format(string,sizeof(string),"{FF8200}%s{FFFFFF} este deja pe lista de banati.", GetPlayeridName(player1));
SendClientMessage(playerid,COLOR_WHITE,string);
}
return 1;
}