[Pomoc]Gamemod0

Započeo caupton, Mart 20, 2011, 23:10:13 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim:Svoju od 0
Detaljan opis problema:Kako da namestim kada nekom dam wanted da on pocrveni ..?
Dio skripte://
Neke slike/video za lakse dobivanje pomoci(neobavezno)://

poznaticovik


Daj komanda /suspect ili kako vec ga imas definirano.
Poslednja Izmena: Mart 21, 2011, 21:57:05 POSLE PODNE od Jamaica



   if(strcmp(cmd, "/suspect", true) == 0 || strcmp(cmd, "/su", true) == 0)
   {
       if(IsPlayerConnected(playerid))
       {
         if(OnDuty[playerid] == 1 && PlayerInfo[playerid][pMember] == 2 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pLeader] == 2 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pMember] == 1 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pLeader] == 1 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pMember] == 11 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pLeader] == 11) { }
         else
         {
             SendClientMessage(playerid, COLOR_GREY, "   Niste na duznosti!");
             return 1;
         }
         tmp = strtok(cmdtext, idx);
         if(!strlen(tmp))
         {
            SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: (/su)spect [ID Igraca/Dio Imena] [opis zlocina]");
            return 1;
         }
         giveplayerid = ReturnUser(tmp);
         if (gTeam[playerid] == 2 || IsACop(playerid))
         {
            if(IsPlayerConnected(giveplayerid))
            {
                if(giveplayerid != INVALID_PLAYER_ID)
                {
                  if (gTeam[giveplayerid] != 2)
                  {
                     GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                     GetPlayerName(playerid, sendername, sizeof(sendername));
                     new length = strlen(cmdtext);
                     while ((idx < length) && (cmdtext[idx] <= ' '))
                     {
                        idx++;
                     }
                     new offset = idx;
                     new result[64];
                     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, "Koriscenje: (/su)spect [ID Igraca/Dio Imena] [crime text]");
                        return 1;
                     }
                     if(WantedPoints[giveplayerid] == 0) { WantedPoints[giveplayerid] = 3; }
                     else { WantedPoints[giveplayerid]+= 2; }
                     SetPlayerCriminalEx(giveplayerid,playerid, result);
                     return 1;
                  }
                  else
                  {
                     SendClientMessage(playerid, COLOR_GRAD2, "   Ne mozete optuziti policajca !");
                  }
               }
            }
            else
            {
                  format(string, sizeof(string), "   %d nije aktivan igrac.", giveplayerid);
                  SendClientMessage(playerid, COLOR_GRAD1, string);
                  return 1;
            }
         }
         else
         {
            SendClientMessage(playerid, COLOR_GRAD2, "   Niste Policajac / BIA / Swat !");
         }
      }
      return 1;
   }


ewo


if(strcmp(cmd, "/suspect", true) == 0 || strcmp(cmd, "/su", true) == 0)
  {
      if(IsPlayerConnected(playerid))
      {
        if(OnDuty[playerid] == 1 && PlayerInfo[playerid][pMember] == 2 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pLeader] == 2 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pMember] == 1 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pLeader] == 1 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pMember] == 11 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pLeader] == 11) { }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "   Niste na duznosti!");
            return 1;
        }
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
           SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: (/su)spect [ID Igraca/Dio Imena] [opis zlocina]");
           return 1;
        }
        giveplayerid = ReturnUser(tmp);
        if (gTeam[playerid] == 2 || IsACop(playerid))
        {
           if(IsPlayerConnected(giveplayerid))
           {
               if(giveplayerid != INVALID_PLAYER_ID)
               {
                 if (gTeam[giveplayerid] != 2)
                 {
                    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    new length = strlen(cmdtext);
                    while ((idx < length) && (cmdtext[idx] <= ' '))
                    {
                       idx++;
                    }
                    new offset = idx;
                    new result[64];
                    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, "Koriscenje: (/su)spect [ID Igraca/Dio Imena] [crime text]");
                       return 1;
                    }
                    if(WantedPoints[giveplayerid] == 0) { WantedPoints[giveplayerid] = 3; }
                    else { WantedPoints[giveplayerid]+= 2; }
                    SetPlayerCriminalEx(giveplayerid,playerid, result);
                    SetPlayerColor(giveplayerid, BOJA);
                    return 1;
                 }
                 else
                 {
                    SendClientMessage(playerid, COLOR_GRAD2, "   Ne mozete optuziti policajca !");
                 }
              }
           }
           else
           {
                 format(string, sizeof(string), "   %d nije aktivan igrac.", giveplayerid);
                 SendClientMessage(playerid, COLOR_GRAD1, string);
                 return 1;
           }
        }
        else
        {
           SendClientMessage(playerid, COLOR_GRAD2, "   Niste Policajac / BIA / Swat !");
        }
     }
     return 1;
  }
Poslednja Izmena: Mart 21, 2011, 22:10:14 POSLE PODNE od [Modern]°°Lopez°°
Modern Roleplay Vlasnik,Uskoro...




Al ste pametni, sada ste mu dali komandu, a nista mu niste objasnili! :-\


Evo ja cu da ti objasnim:
SetPlayerColor(playerid, BOJA); // SetPlayerColor postavlja boju igraca, playerid je ID igraca, u ovom slucaju koristis giveplayerid, BOJA je boja koja ce se postaviti!

Citat: [AG] N1n0 poslato Mart 21, 2011, 23:07:44 POSLE PODNE
Al ste pametni, sada ste mu dali komandu, a nista mu niste objasnili! :-\


Evo ja cu da ti objasnim:
SetPlayerColor(playerid, BOJA); // SetPlayerColor postavlja boju igraca, playerid je ID igraca, u ovom slucaju koristis giveplayerid, BOJA je boja koja ce se postaviti!

Jesmo, playerid ?