[POMOC]CMD WARN


Započeo MosT_WanteD, Avgust 01, 2011, 00:50:58 PRE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim:MOJ MOD OD 0
Detaljan opis problema:Pa uradio sam CMD Warn i kada dobijem ban nakog petog warna mogu davati warnve beskonacno kad dobijem ban.Znaci dadnem sam sebi ban idem 5 puta /warn 0 e i onda obrisem iz samp bana i udem opet i mogu dati 100000000000 warnova ako ocu pa evo vam cmd pa vas molim recite mi sta da ubacim da posliije 5 warna svaki sljedeci warn bude ban znaci 6 warn ban 7 warn ban itd.Jer sam nesto zaboravio ubacit al se nmg sjetit sta.
Dio skripte:Komande
CMD:warn(playerid, params[])
    {
            new string[128];
	new file[256];

        if(PlayerInfo[playerid][pAdmin] >= 1 || (PlayerInfo[playerid][pGameMaster] >5))
            {


                new tmp[256], tmp2[256], Index;
                    tmp = strtok(params,Index), tmp2 = strtok(params,Index);
                                                        new kohde;
                kohde = strval(tmp);
                    new Ip[16];
                GetPlayerIp(kohde,Ip,sizeof(Ip));

                    if(!strlen(params)) return SendClientMessage(playerid, COLOR_RED, "Napisi: /warn [ID] [razlog]");
new id;
        if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid,-1,"id nepostojiiii!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");


                    if(!strlen(tmp2)) return SendClientMessage(playerid, red, "Napisi: /warn [ID] [razlog]");

                    if(IsPlayerNPC(kohde)) return SendClientMessage(playerid, COLOR_RED, "Lol nemres NPC warnati");

                    if(!IsPlayerConnected(kohde)) return SendClientMessage(playerid, COLOR_RED, "Netocan ID");
                    if(PlayerInfo[kohde][pWarnings] == 4)
{
                    SendClientMessage(playerid,COLOR_YELLOW,"SLIKAJ OBAVEZNO");
                    format(string, sizeof(string), "Banao si igraca %s",PlayerName(kohde));
                    SendClientMessage(playerid,COLOR_LIGHTRED, string);
                    format(string, sizeof(string), "IP Adresa  igraca  je %s slikaj i spremi da ga mozes unbanati (/unbanip) i postavi na forum",Ip);
                    SendClientMessage(playerid,COLOR_LIGHTRED, string);
                      format(string, sizeof(string), "Igrac %s je banovan sa servera (RAZLOG 5 UPOZORENJA)",PlayerName(kohde));
                    SCMToAll(COLOR_DARKRED, string);
                    Ban(kohde);
                    }

                    format(string, sizeof(string), "Upozorenje: %s je Upozoren. (razlog: %s)", PlayerName(kohde), params[2]);
                SendClientMessageToAll(COLOR_RED, string);

                    PlayerInfo[kohde][pWarnings] ++;

                    PlayerPlaySound(kohde,1057,0.0,0.0,0.0);

                   
                   	format(file,sizeof(file),"igraci/%s.ini", PlayerName(playerid));

                    dini_IntSet(FilePath,"Upozorenja", PlayerInfo[kohde][pWarnings]);
                    return 1;
            }
            return 1;
    }

Neke slike/video za lakse dobivanje pomoci(neobavezno)://
Poslednja Izmena: Avgust 01, 2011, 00:51:31 PRE PODNE od _MosT_WanteD_
LOL

CMD:warn(playerid, params[])
    {
            new string[128];
	new file[256];

        if(PlayerInfo[playerid][pAdmin] >= 1 || (PlayerInfo[playerid][pGameMaster] >5))
            {


                new tmp[256], tmp2[256], Index;
                    tmp = strtok(params,Index), tmp2 = strtok(params,Index);
                                                        new kohde;
                kohde = strval(tmp);
                    new Ip[16];
                GetPlayerIp(kohde,Ip,sizeof(Ip));

                    if(!strlen(params)) return SendClientMessage(playerid, COLOR_RED, "Napisi: /warn [ID] [razlog]");
new id;
        if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid,-1,"id nepostojiiii!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");


                    if(!strlen(tmp2)) return SendClientMessage(playerid, red, "Napisi: /warn [ID] [razlog]");

                    if(IsPlayerNPC(kohde)) return SendClientMessage(playerid, COLOR_RED, "Lol nemres NPC warnati");

                    if(!IsPlayerConnected(kohde)) return SendClientMessage(playerid, COLOR_RED, "Netocan ID");
                    if(PlayerInfo[kohde][pWarnings] >= 4)
{
                    SendClientMessage(playerid,COLOR_YELLOW,"SLIKAJ OBAVEZNO");
                    format(string, sizeof(string), "Banao si igraca %s",PlayerName(kohde));
                    SendClientMessage(playerid,COLOR_LIGHTRED, string);
                    format(string, sizeof(string), "IP Adresa  igraca  je %s slikaj i spremi da ga mozes unbanati (/unbanip) i postavi na forum",Ip);
                    SendClientMessage(playerid,COLOR_LIGHTRED, string);
                      format(string, sizeof(string), "Igrac %s je banovan sa servera (RAZLOG 5 UPOZORENJA)",PlayerName(kohde));
                    SCMToAll(COLOR_DARKRED, string);
                    Ban(kohde);
                    }

                    format(string, sizeof(string), "Upozorenje: %s je Upozoren. (razlog: %s)", PlayerName(kohde), params[2]);
                SendClientMessageToAll(COLOR_RED, string);

                    PlayerInfo[kohde][pWarnings] ++;

                    PlayerPlaySound(kohde,1057,0.0,0.0,0.0);

                   
                   	format(file,sizeof(file),"igraci/%s.ini", PlayerName(playerid));

                    dini_IntSet(FilePath,"Upozorenja", PlayerInfo[kohde][pWarnings]);
                    return 1;
            }
            return 1;
    }

eto, sad ce ti raditi...
Just one more time.