Korisne skripte i kodovi

Započeo matejdz, Maj 05, 2009, 12:15:21 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 3 gostiju pregledaju ovu temu.


Citat: Nodypocetnik poslato Avgust 31, 2009, 00:34:01 PRE PODNE
jesam ali nece

Kako dodajes objekte,jesi CreateStreamObject(x,y,z,rotx,roty,rotz,distanca)

mozda si zaboravio distancu,stavi 500.00 ako si nju fulio  ;)


Svi koji igraju CS-a neka nam se pridruze (:

zerocoolos

Neki su spominjali komandu /clanovi i /lideri pa evo ih. Nisam imao vrmena da ih napravim sa dcmd pa evo ovako


    if ((strcmp(cmdtext, "/clanovi", true)==0)||(strcmp(cmdtext,"/members",true)==0))
    {
          if(PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 1)
          {
          if(IsPlayerConnected(playerid))
      {
  SendClientMessage(playerid, COLOR_GOLD, "____________ PD clanovi online ____________");
  for(new i = 0; i < MAX_PLAYERS; i++)
  {
  if(IsPlayerConnected(i))
  {
      if(PlayerInfo[i][pMember] == 1||PlayerInfo[i][pLeader] == 1)
      {
  GetPlayerName(i, sendername, sizeof(sendername));
  format(string, 256, "    - %s", sendername);
  SendClientMessage(playerid, COLOR_IVORY, string);
  }
  }
  }
    SendClientMessage(playerid, COLOR_GOLD, "__________________________________________");
  }
  return 1;
          }
          else if(PlayerInfo[playerid][pMember] == 2||PlayerInfo[playerid][pLeader] == 2)
          {
          if(IsPlayerConnected(playerid))
      {
  SendClientMessage(playerid, COLOR_GOLD, "____________ FBI clanovi online ____________");
  for(new i = 0; i < MAX_PLAYERS; i++)
  {
  if(IsPlayerConnected(i))
  {
      if(PlayerInfo[i][pMember] == 2||PlayerInfo[i][pLeader] == 2)
      {
  GetPlayerName(i, sendername, sizeof(sendername));
  format(string, 256, "    - %s", sendername);
  SendClientMessage(playerid, COLOR_IVORY, string);
  }
  }
  }
    SendClientMessage(playerid, COLOR_GOLD, "__________________________________________");
  }
  return 1;
          }


dalje samo dodavajte else if(PlayerInfo[playerid][pMember] == n||PlayerInfo[playerid][pLeader] == n)
ma skontat cete sami, uglavnom oni koji ne mogu to skontat n je broj koji zamjenite brojem org...

druga komanda:
if (strcmp(cmd, "/lideri", true) == 0)
{
        if(IsPlayerConnected(playerid))
    {
SendClientMessage(playerid, COLOR_BRIGHTRED, "________ Lideri Online ________");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
    if(PlayerInfo[i][pLeader] == 1)
    {
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "PD Lider: %s", sendername);
SendClientMessage(playerid, COLOR_FLBLUE, string);
}
}
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
    if(PlayerInfo[i][pLeader] == 2)
    {
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "FBI Lider: %s", sendername);
SendClientMessage(playerid, COLOR_BLUE, string);
}
}
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
    if(PlayerInfo[i][pLeader] == n)
    {
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "Lider zeljene org: %s", sendername);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
}
}


takodjer n zamijenite za zeljenim brojem org...

Nadam se da sam nekim pomogao...

Citat: zerocoolos poslato Avgust 31, 2009, 01:51:13 PRE PODNE
Neki su spominjali komandu /clanovi i /lideri pa evo ih. Nisam imao vrmena da ih napravim sa dcmd pa evo ovako


    if ((strcmp(cmdtext, "/clanovi", true)==0)||(strcmp(cmdtext,"/members",true)==0))
    {
          if(PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 1)
          {
          if(IsPlayerConnected(playerid))
      {
  SendClientMessage(playerid, COLOR_GOLD, "____________ PD clanovi online ____________");
  for(new i = 0; i < MAX_PLAYERS; i++)
  {
  if(IsPlayerConnected(i))
  {
      if(PlayerInfo[i][pMember] == 1||PlayerInfo[i][pLeader] == 1)
      {
  GetPlayerName(i, sendername, sizeof(sendername));
  format(string, 256, "    - %s", sendername);
  SendClientMessage(playerid, COLOR_IVORY, string);
  }
  }
  }
    SendClientMessage(playerid, COLOR_GOLD, "__________________________________________");
  }
  return 1;
          }
          else if(PlayerInfo[playerid][pMember] == 2||PlayerInfo[playerid][pLeader] == 2)
          {
          if(IsPlayerConnected(playerid))
      {
  SendClientMessage(playerid, COLOR_GOLD, "____________ FBI clanovi online ____________");
  for(new i = 0; i < MAX_PLAYERS; i++)
  {
  if(IsPlayerConnected(i))
  {
      if(PlayerInfo[i][pMember] == 2||PlayerInfo[i][pLeader] == 2)
      {
  GetPlayerName(i, sendername, sizeof(sendername));
  format(string, 256, "    - %s", sendername);
  SendClientMessage(playerid, COLOR_IVORY, string);
  }
  }
  }
    SendClientMessage(playerid, COLOR_GOLD, "__________________________________________");
  }
  return 1;
          }


dalje samo dodavajte else if(PlayerInfo[playerid][pMember] == n||PlayerInfo[playerid][pLeader] == n)
ma skontat cete sami, uglavnom oni koji ne mogu to skontat n je broj koji zamjenite brojem org...

druga komanda:
if (strcmp(cmd, "/lideri", true) == 0)
{
        if(IsPlayerConnected(playerid))
    {
SendClientMessage(playerid, COLOR_BRIGHTRED, "________ Lideri Online ________");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
    if(PlayerInfo[i][pLeader] == 1)
    {
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "PD Lider: %s", sendername);
SendClientMessage(playerid, COLOR_FLBLUE, string);
}
}
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
    if(PlayerInfo[i][pLeader] == 2)
    {
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "FBI Lider: %s", sendername);
SendClientMessage(playerid, COLOR_BLUE, string);
}
}
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
    if(PlayerInfo[i][pLeader] == n)
    {
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "Lider zeljene org: %s", sendername);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
}
}


takodjer n zamijenite za zeljenim brojem org...

Nadam se da sam nekim pomogao...

hvala djuro care


Svi koji igraju CS-a neka nam se pridruze (:

Citat: zerocoolos poslato Avgust 31, 2009, 01:51:13 PRE PODNE
Neki su spominjali komandu /clanovi i /lideri pa evo ih. Nisam imao vrmena da ih napravim sa dcmd pa evo ovako


    if ((strcmp(cmdtext, "/clanovi", true)==0)||(strcmp(cmdtext,"/members",true)==0))
    {
          if(PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 1)
          {
          if(IsPlayerConnected(playerid))
      {
  SendClientMessage(playerid, COLOR_GOLD, "____________ PD clanovi online ____________");
  for(new i = 0; i < MAX_PLAYERS; i++)
  {
  if(IsPlayerConnected(i))
  {
      if(PlayerInfo[i][pMember] == 1||PlayerInfo[i][pLeader] == 1)
      {
  GetPlayerName(i, sendername, sizeof(sendername));
  format(string, 256, "    - %s", sendername);
  SendClientMessage(playerid, COLOR_IVORY, string);
  }
  }
  }
    SendClientMessage(playerid, COLOR_GOLD, "__________________________________________");
  }
  return 1;
          }
          else if(PlayerInfo[playerid][pMember] == 2||PlayerInfo[playerid][pLeader] == 2)
          {
          if(IsPlayerConnected(playerid))
      {
  SendClientMessage(playerid, COLOR_GOLD, "____________ FBI clanovi online ____________");
  for(new i = 0; i < MAX_PLAYERS; i++)
  {
  if(IsPlayerConnected(i))
  {
      if(PlayerInfo[i][pMember] == 2||PlayerInfo[i][pLeader] == 2)
      {
  GetPlayerName(i, sendername, sizeof(sendername));
  format(string, 256, "    - %s", sendername);
  SendClientMessage(playerid, COLOR_IVORY, string);
  }
  }
  }
    SendClientMessage(playerid, COLOR_GOLD, "__________________________________________");
  }
  return 1;
          }


dalje samo dodavajte else if(PlayerInfo[playerid][pMember] == n||PlayerInfo[playerid][pLeader] == n)
ma skontat cete sami, uglavnom oni koji ne mogu to skontat n je broj koji zamjenite brojem org...

druga komanda:
if (strcmp(cmd, "/lideri", true) == 0)
{
        if(IsPlayerConnected(playerid))
    {
SendClientMessage(playerid, COLOR_BRIGHTRED, "________ Lideri Online ________");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
    if(PlayerInfo[i][pLeader] == 1)
    {
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "PD Lider: %s", sendername);
SendClientMessage(playerid, COLOR_FLBLUE, string);
}
}
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
    if(PlayerInfo[i][pLeader] == 2)
    {
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "FBI Lider: %s", sendername);
SendClientMessage(playerid, COLOR_BLUE, string);
}
}
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
    if(PlayerInfo[i][pLeader] == n)
    {
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "Lider zeljene org: %s", sendername);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
}
}


takodjer n zamijenite za zeljenim brojem org...

Nadam se da sam nekim pomogao...

fuck na /lideri mi izbaci 26 errora :S  a uradim isto tako...


Svi koji igraju CS-a neka nam se pridruze (:

zerocoolos

pa kad nije cijela komanda, moras sve sta otvoris i zatvorit

Citat: zerocoolos poslato Avgust 31, 2009, 03:09:20 PRE PODNE
pa kad nije cijela komanda, moras sve sta otvoris i zatvorit

uradio tnx


Svi koji igraju CS-a neka nam se pridruze (:

Prvo forward CheckPing ();

pa onda ubacite ovo:

//---------------------------------ping kick--------------------------------------------------------
if(strcmp(cmd, "/setping",true ) == 0)
   {
   if (PlayerInfo[playerid][pAdmin] >= 3 //stavi koji oces lvl admina da to moze raditi)
   {
   if(IsPlayerConnected(playerid))
   {
   tmp = strtok(cmdtext, idx);
   if(!strlen(tmp))
   {
    SendClientMessage(playerid,COLOR_ORANGE,"[PingKicker] Koristi: /setping [MaxPing]");
       return 1;
}
   if(strval(tmp) < 200 || strval(tmp) > 2000) //minimalni i max ping
   {
        SendClientMessage(playerid,COLOR_ORANGE,"[PingKicker] Upozorenje! Minimum je 200 a Maximum je 2000!");
        return 1;
}
   MaxPing = strval(tmp);
   GetPlayerName(playerid, pName, sizeof(pName));
   format(string,256,"[PingKicker] Admin %s[ID:%d] je stavio max ping do %d!",pName,playerid,MaxPing);
   SendClientMessageToAll(COLOR_LIGHTRED,string);
   }
   else
{
       SendClientMessage(playerid,COLOR_ORANGE,"[PingKicker] You are not Admin!");
       return 1;
}
}
}


Pa onda ubacite

public CheckPing()
{
   for(new i; i < MAX_PLAYERS; i++)
   {
        if(IsPlayerConnected(i))
        {
        if(GetPlayerPing(i) >= MaxPing)
        {
        new Year,Month,Day;
    new Hour,Min,Sec;
        new pName[MAX_PLAYER_NAME];
        new string[256];

        getdate(Year,Month,Day);
gettime(Hour,Min,Sec);

GetPlayerName(i, pName, sizeof(pName));
        format(string,256,"[PingKicker] %s[ID:%d] je kickovan. Razlog: Veliki ping (Max. dozvoljeni ping: %d)",pName,i,MaxPing);
        SendClientMessageToAll(COLOR_ORANGE,string);
        format(string,256,"%s[ID:%d] has been kicked - %d/%d/%d at %d:%d and %d seconds, resean: High Ping",pName,i,Day,Month,Year,Hour,Min,Sec);
        KickLog(string);
        Kick(i);
        }
    }
}
}
   




Eto ako nemate tu komandu pa je stavite..nije losa kickuje ukoliko imate veci ping od dozvoljenog  ;)
Poslednja Izmena: Avgust 31, 2009, 04:13:18 PRE PODNE od Johny


Svi koji igraju CS-a neka nam se pridruze (:

Chrome

ovo samo stavlja varijablu "MaxPing" na zeljni iznos.. nista drugo  ;)

Citat: Chrome poslato Avgust 31, 2009, 03:57:59 PRE PODNE
ovo samo stavlja varijablu "MaxPing" na zeljni iznos.. nista drugo  ;)

stavlja tebi varijablu u mozak,aj se ti prihvati svog ysi i suti bgt ;D


Svi koji igraju CS-a neka nam se pridruze (:

SetTimer("CheckPing",2000,1);

    MaxPing = 1000;



ovo sam zaboravio jos za ping dodati..to postavite u OnGameModeInit


Svi koji igraju CS-a neka nam se pridruze (:

Chrome

a jel ti znas da treba oko 3-4 sec da se playeru koji se konektirao pravilo sync-a ping sa serverom.. eto ti sad  :P

matejdz

Ma Bullet kome ti objasnjavas, vidis da nezna osnovu, a onda uzima neke :S naredbe od nekud thumbsup

A ti u buduce potpisi autora inace BANanko BANana tvoja je hrana, BANanko BANana Johny obozaavaaaaa
Poslednja Izmena: Avgust 31, 2009, 07:52:06 PRE PODNE od [CH]matejdz

Kad stavim onu od djure komandu pod onplayercommandtext izbaci mi 26 errora.
Evo kako komanda izgleda:
//----------------------------------------/clanovi---------------------------
if ((strcmp(cmdtext, "/clanovi", true)==0)||(strcmp(cmdtext,"/members",true)==0))
   {
         if(PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 1)
         {
         if(IsPlayerConnected(playerid))
     {
 SendClientMessage(playerid, COLOR_GOLD, "____________ PD clanovi online ____________");
 for(new i = 0; i < MAX_PLAYERS; i++)
 {
 if(IsPlayerConnected(i))
 {
     if(PlayerInfo[i][pMember] == 1||PlayerInfo[i][pLeader] == 1)
     {
 GetPlayerName(i, sendername, sizeof(sendername));
 format(string, 256, "    - %s", sendername);
 SendClientMessage(playerid, COLOR_IVORY, string);
 }
 }
 }
   SendClientMessage(playerid, COLOR_GOLD, "__________________________________________");
 }
 return 1;
         }
         else if(PlayerInfo[playerid][pMember] == 2||PlayerInfo[playerid][pLeader] == 2)
         {
         if(IsPlayerConnected(playerid))
     {
 SendClientMessage(playerid, COLOR_GOLD, "____________ FBI clanovi online ____________");
 for(new i = 0; i < MAX_PLAYERS; i++)
 {
 if(IsPlayerConnected(i))
 {
     if(PlayerInfo[i][pMember] == 2||PlayerInfo[i][pLeader] == 2)
     {
 GetPlayerName(i, sendername, sizeof(sendername));
 format(string, 256, "    - %s", sendername);
 SendClientMessage(playerid, COLOR_IVORY, string);
 }
 }
 }
   SendClientMessage(playerid, COLOR_GOLD, "__________________________________________");
 }
 return 1;
         }
         else if(PlayerInfo[playerid][pMember] == 3||PlayerInfo[playerid][pLeader] == 3)
         {
         if(IsPlayerConnected(playerid))
     {
 SendClientMessage(playerid, COLOR_GOLD, "____________ S.W.A.T. clanovi online ____________");
 for(new i = 0; i < MAX_PLAYERS; i++)
 {
 if(IsPlayerConnected(i))
 {
     if(PlayerInfo[i][pMember] == 3||PlayerInfo[i][pLeader] == 3)
     {
 GetPlayerName(i, sendername, sizeof(sendername));
 format(string, 256, "    - %s", sendername);
 SendClientMessage(playerid, COLOR_IVORY, string);
 }
 }
 }
   SendClientMessage(playerid, COLOR_GOLD, "__________________________________________");
 }
 return 1;
         }
         else if(PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pLeader] == 4)
         {
         if(IsPlayerConnected(playerid))
     {
 SendClientMessage(playerid, COLOR_GOLD, "____________ MD clanovi online ____________");
 for(new i = 0; i < MAX_PLAYERS; i++)
 {
 if(IsPlayerConnected(i))
 {
     if(PlayerInfo[i][pMember] == 4||PlayerInfo[i][pLeader] == 4)
     {
 GetPlayerName(i, sendername, sizeof(sendername));
 format(string, 256, "    - %s", sendername);
 SendClientMessage(playerid, COLOR_IVORY, string);
 }
 }
 }
   SendClientMessage(playerid, COLOR_GOLD, "__________________________________________");
 }
 return 1;
         }
         else if(PlayerInfo[playerid][pMember] == 5||PlayerInfo[playerid][pLeader] == 5)
         {
         if(IsPlayerConnected(playerid))
     {
 SendClientMessage(playerid, COLOR_GOLD, "____________ LCN clanovi online ____________");
 for(new i = 0; i < MAX_PLAYERS; i++)
 {
 if(IsPlayerConnected(i))
 {
     if(PlayerInfo[i][pMember] == 5||PlayerInfo[i][pLeader] == 5)
     {
 GetPlayerName(i, sendername, sizeof(sendername));
 format(string, 256, "    - %s", sendername);
 SendClientMessage(playerid, COLOR_IVORY, string);
 }
 }
 }
   SendClientMessage(playerid, COLOR_GOLD, "__________________________________________");
 }
 return 1;
         }
         else if(PlayerInfo[playerid][pMember] == 6||PlayerInfo[playerid][pLeader] == 6)
         {
         if(IsPlayerConnected(playerid))
     {
 SendClientMessage(playerid, COLOR_GOLD, "____________ Yakuza clanovi online ____________");
 for(new i = 0; i < MAX_PLAYERS; i++)
 {
 if(IsPlayerConnected(i))
 {
     if(PlayerInfo[i][pMember] == 6||PlayerInfo[i][pLeader] == 6)
     {
 GetPlayerName(i, sendername, sizeof(sendername));
 format(string, 256, "    - %s", sendername);
 SendClientMessage(playerid, COLOR_IVORY, string);
 }
 }
 }
   SendClientMessage(playerid, COLOR_GOLD, "__________________________________________");
 }
 return 1;
         }
         else if(PlayerInfo[playerid][pMember] == 8||PlayerInfo[playerid][pLeader] == 8)
         {
         if(IsPlayerConnected(playerid))
     {
 SendClientMessage(playerid, COLOR_GOLD, "____________ Hitman clanovi online ____________");
 for(new i = 0; i < MAX_PLAYERS; i++)
 {
 if(IsPlayerConnected(i))
 {
     if(PlayerInfo[i][pMember] == 8||PlayerInfo[i][pLeader] == 8)
     {
 GetPlayerName(i, sendername, sizeof(sendername));
 format(string, 256, "    - %s", sendername);
 SendClientMessage(playerid, COLOR_IVORY, string);
 }
 }
 }
   SendClientMessage(playerid, COLOR_GOLD, "__________________________________________");
 }
 return 1;
         }
         else if(PlayerInfo[playerid][pMember] == 9||PlayerInfo[playerid][pLeader] == 9)
         {
         if(IsPlayerConnected(playerid))
     {
 SendClientMessage(playerid, COLOR_GOLD, "____________ News clanovi online ____________");
 for(new i = 0; i < MAX_PLAYERS; i++)
 {
 if(IsPlayerConnected(i))
 {
     if(PlayerInfo[i][pMember] == 9||PlayerInfo[i][pLeader] == 9)
     {
 GetPlayerName(i, sendername, sizeof(sendername));
 format(string, 256, "    - %s", sendername);
 SendClientMessage(playerid, COLOR_IVORY, string);
 }
 }
 }
   SendClientMessage(playerid, COLOR_GOLD, "__________________________________________");
 }
 return 1;
         }
         else if(PlayerInfo[playerid][pMember] == 10||PlayerInfo[playerid][pLeader] == 10)
         {
         if(IsPlayerConnected(playerid))
     {
 SendClientMessage(playerid, COLOR_GOLD, "____________ Taxi clanovi online ____________");
 for(new i = 0; i < MAX_PLAYERS; i++)
 {
 if(IsPlayerConnected(i))
 {
     if(PlayerInfo[i][pMember] == 10||PlayerInfo[i][pLeader] == 10)
     {
 GetPlayerName(i, sendername, sizeof(sendername));
 format(string, 256, "    - %s", sendername);
 SendClientMessage(playerid, COLOR_IVORY, string);
 }
 }
 }
   SendClientMessage(playerid, COLOR_GOLD, "__________________________________________");
 }
 return 1;
         }
         else if(PlayerInfo[playerid][pMember] == 11||PlayerInfo[playerid][pLeader] == 11)
         {
         if(IsPlayerConnected(playerid))
     {
 SendClientMessage(playerid, COLOR_GOLD, "____________ Licenser clanovi online ____________");
 for(new i = 0; i < MAX_PLAYERS; i++)
 {
 if(IsPlayerConnected(i))
 {
     if(PlayerInfo[i][pMember] == 11||PlayerInfo[i][pLeader] == 11)
     {
 GetPlayerName(i, sendername, sizeof(sendername));
 format(string, 256, "    - %s", sendername);
 SendClientMessage(playerid, COLOR_IVORY, string);
 }
 }
 }
   SendClientMessage(playerid, COLOR_GOLD, "__________________________________________");
 }
 return 1;
         }



USPIO SAM!!!
Poslednja Izmena: Avgust 31, 2009, 09:53:05 PRE PODNE od sorfa

Na kraju stavi jos jednu ovakvu zagradu }
Trebalo bi radit tako je i meni bilo na komandi /clanovi