Pomoc warn

Započeo Nemanjaf, Oktobar 27, 2010, 23:09:47 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Nemanjaf

Da li neko moze da mi pokaze kako da napravim konadu /warn
i da sa 3 warna dobije igrac /ban na 1 nedelju

evo
if(strcmp(cmd, "/warn", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
    tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koristi: /warn [playerid/PartOfName] [reason]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(IsPlayerConnected(giveplayerid))
{
    if(giveplayerid != INVALID_PLAYER_ID)
    {
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koristi: /warn [playerid/PartOfName] [reason]");
return 1;
      }
      format(string, sizeof(string), "%s",(result));
      new targetlevel = PlayerInfo[giveplayerid][pAdmin];
new playerlevel = PlayerInfo[playerid][pAdmin];
if(targetlevel > playerlevel) return SendClientMessage(playerid, COLOR_GREY, "* You can not ban People that is higher Than You!");
                        if(giveplayerid != playerid && Untouchable[giveplayerid]) return SendClientMessage(playerid, COLOR_GREY, "* You Can't Do this on This player!");
      if(PlayerInfo[giveplayerid][pWarned] == 0)
      {

new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has warned %s for: %s",d,m,y,h,mi,s,sendername,giveplayer, (result));
WarnLog(string);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] Warned by %s - Reason: %s",d,m,y,h,mi,s,sendername,(result));
AddPunishment(giveplayerid, string);
format(string, sizeof(string), "%s (%d), Has been Warned by Administrator %s for %s", giveplayer,giveplayerid, sendername, (result));
SendClientMessageToAll(COLOR_NICERED, string);
format(string, sizeof(string), "You Have been Warned by Administrator %s for %s",sendername, (result));
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pWarned] = 1;
format(string, sizeof(string), "[ADMIN]: %s Has Warned %s (%d) for %s",sendername,giveplayer,giveplayerid, (result));
SendAdminMessage(COLOR_LIGHTRED,string);
new Float:wx, Float:wy, Float:wz;
GetPlayerPos(giveplayerid,wx, wy, wz);
return 1;
}
else if(PlayerInfo[giveplayerid][pWarned] == 1)
      {
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has warned %s for: %s",d,m,y,h,mi,s,sendername,giveplayer, (result));
WarnLog(string);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] Warned by %s - Reason: %s",d,m,y,h,mi,s,sendername,(result));
AddPunishment(giveplayerid, string);
format(string, sizeof(string), "%s, Has been Warned by Administrator %s for %s", giveplayer, sendername, (result));
SendClientMessageToAll(COLOR_NICERED, string);
format(string, sizeof(string), "You Have been Warned by Administrator %s for %s",sendername, (result));
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pWarned] = 2;
format(string, sizeof(string), "[ADMIN]: %s Has Warned %s (%d) for %s",sendername,giveplayer,giveplayerid, (result));
SendAdminMessage(COLOR_LIGHTRED,string);
new Float:wx, Float:wy, Float:wz;
GetPlayerPos(giveplayerid,wx, wy, wz);
return 1;
}
else if(PlayerInfo[giveplayerid][pWarned] == 2)
{
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has kicked %s for: %s",d,m,y,h,mi,s,sendername,giveplayer, (result));
WarnLog(string);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] Kicked by %s - Reason: %s",d,m,y,h,mi,s,sendername,(result));
AddPunishment(giveplayerid, string);
format(string, sizeof(string), "%s, Has been Kicked by Administrator %s for %s", giveplayer, sendername, (result));
SendClientMessageToAll(COLOR_NICERED, string);
format(string, sizeof(string), "You Have been Warned by Administrator %s for %s",sendername, (result));
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pWarned] = 0;
format(string, sizeof(string), "[ADMIN]: %s Has Warned %s (%d) for %s",sendername,giveplayer,giveplayerid, (result));
SendAdminMessage(COLOR_LIGHTRED,string);
SafeSetPlayerPos(giveplayerid,264.6288,77.5742,1001.0391);
    SafeSetPlayerInterior(giveplayerid, 6);
Kick(giveplayerid);
return 1;
}
}
}
else
{
format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
}
return 1;
}




Pročitaj pravila foruma.
Povratak na balkan-samp  :)  15.01.2013. 
..   


Respect : [BP]HeLoX, Correlli, [CH:FR]Djea, LordShigi, LuKsA, BloodMaster, [H]265