[Pomoc]/news

Započeo Ante_Street, Jun 28, 2011, 11:48:41 PRE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: LARP
Detaljan opis problema: ja sam radio vozila na principu ovog tut-a http://balkan-samp.com/forum/index.php?topic=18121.0
Ovaj crveni dio od news mi treba da nije na id auta vec na ovaj tut
Dio skripte:

if(strcmp(cmd, "/news", true) == 0)
{
   if(IsPlayerConnected(playerid))
   {
if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9)
{
       if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "Nemozes pricati,usutkan si");
return 1;
}
new counter = 0;
    [color=red]for(new i = 119; i <= 119; i++)[/color]
    {
       new dist = CheckPlayerDistanceToVehicle(7, playerid, i);
       if(dist)
       {
           counter++;
       }
    }
    if(counter == 0)
    {
SendClientMessage(playerid, COLOR_GREY, "   You're not near/in your news van/chopper !");
return 1;
    }
    else
    {

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: /news [newstext]");
return 1;
}
new rtext[64];
if(PlayerInfo[playerid][pRank] == 1) { rtext = "Intern Worker"; }
else if(PlayerInfo[playerid][pRank] == 2) { rtext = "Journalist"; }
else if(PlayerInfo[playerid][pRank] == 3) { rtext = "Head Journalist"; }
else if(PlayerInfo[playerid][pRank] == 4) { rtext = "Company Secretary"; }
else if(PlayerInfo[playerid][pRank] == 5) { rtext = "ABC Manager"; }
    else if(PlayerInfo[playerid][pRank] == 6) { rtext = "Network Producer"; }
else { rtext = "Intern Worker"; }
format(string, sizeof(string), "[ABC Vijesti] %s %s: %s", rtext, sendername, result);
OOCNews(COLOR_NEWS,string);
PlayerInfo[playerid][pNewsSkill] ++;
if(PlayerInfo[playerid][pNewsSkill] == 50)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 2, soon you are able to Fly the News Chopper and talk Live."); }
else if(PlayerInfo[playerid][pNewsSkill] == 100)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 3, soon you are able to Fly the News Chopper and talk Live."); }
else if(PlayerInfo[playerid][pNewsSkill] == 200)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 4, you can fly the News Chopper now."); }
else if(PlayerInfo[playerid][pNewsSkill] == 400)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 5, you can now talk Live with any person you want."); }
}
}
else
{
   SendClientMessage(playerid, COLOR_GREY, "  Nisi novinar !");
}
}//not connected
return 1;
}



Moderator:
Ja neznam sto je toliko tesko staviti "[","]"? Sledeci put stavljaj kode u [ code ][ /code ]!
Poslednja Izmena: Jun 28, 2011, 12:57:17 POSLE PODNE od _eXtreme_
Trazim "Profesionalnog Skriptera" da mi napravi jednu stvar,cijena nebitna nek mi se javi na pm....trazim lika koji zna raditi ne nekog pocetnika

Kako su ti definirana vozila od CNN.

Citat: FireMan poslato Jun 28, 2011, 12:42:23 POSLE PODNE
Kako su ti definirana vozila od CNN.
new cnnauto[10];
forward IsAcnnauto(carid);
public IsAcnnauto(carid)
{
   for(new i = 0; i < sizeof(cnnauto); i++)
   {
      if(carid == cnnauto)   return 1;
   }
   return 0;
}
Eto tako sam definira
Trazim "Profesionalnog Skriptera" da mi napravi jednu stvar,cijena nebitna nek mi se javi na pm....trazim lika koji zna raditi ne nekog pocetnika

imas li sada kod vozila

cnnauto [0] = Addstatic....
krenes od 0 pa povecas za 1 kako dodajes novo vozilo
Poslednja Izmena: Jun 28, 2011, 23:05:48 POSLE PODNE od [A]Ricky
//

Citat: [A]Ricky poslato Jun 28, 2011, 23:04:24 POSLE PODNE
imas li sada kod vozila

cnnauto [0] = Addstatic....
krenes od 0 pa povecas za 1 kako dodajes novo vozilo
Ja tebe nista nekontam pitao sam za /news komandu ne izradu vozila za org/bande(bez id-a)
Poslednja Izmena: Jun 29, 2011, 01:19:20 PRE PODNE od Ante_Street
Trazim "Profesionalnog Skriptera" da mi napravi jednu stvar,cijena nebitna nek mi se javi na pm....trazim lika koji zna raditi ne nekog pocetnika


if(strcmp(cmd, "/news", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9)
{
        if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "You cannot speak, you have been silenced");
return 1;
}
new newcar = GetPlayerVehicleID(playerid);
new playa;
playa = ReturnUser(tmp);
if(IsAcnnauto(newcar))
    {

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_GREY, "Koristi: /news [newstext]");
return 1;
}
new rtext[64];
if(PlayerInfo[playerid][pRank] == 1) { rtext = "Mladi Novinar"; }
else if(PlayerInfo[playerid][pRank] == 2) { rtext = "Novinar"; }
else if(PlayerInfo[playerid][pRank] == 3) { rtext = "Reporter"; }
else if(PlayerInfo[playerid][pRank] == 4) { rtext = "Stariji Novinar"; }
else if(PlayerInfo[playerid][pRank] == 5) { rtext = "Urednik"; }
    else if(PlayerInfo[playerid][pRank] == 6) { rtext = "Glavni Urednik"; }
else { rtext = "Intern Worker"; }
format(string, sizeof(string), "Vijesti | %s %s |: %s", rtext, sendername, result);
OOCNews(COLOR_ORANGE,string);
PlayerInfo[playerid][pNewsSkill] ++;
if(PlayerInfo[playerid][pNewsSkill] == 50)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 2, soon you are able to Fly the News Chopper and talk Live."); }
else if(PlayerInfo[playerid][pNewsSkill] == 100)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 3, soon you are able to Fly the News Chopper and talk Live."); }
else if(PlayerInfo[playerid][pNewsSkill] == 200)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 4, you can fly the News Chopper now."); }
else if(PlayerInfo[playerid][pNewsSkill] == 400)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 5, you can now talk Live with any person you want."); }
}
}
else
{
    SendClientMessage(playerid, COLOR_GREY, "   You are not a News Reporter !");
}
                        else
{
    SendClientMessage(playerid, COLOR_GREY, "   Nisi u vozilu CNN-a");
}
}//not connected
return 1;
}

Eror:error 029: invalid expression, assumed zero
Warning:warning 204: symbol is assigned a value that is never used: "playa"
Trazim "Profesionalnog Skriptera" da mi napravi jednu stvar,cijena nebitna nek mi se javi na pm....trazim lika koji zna raditi ne nekog pocetnika


Citat: Ante_Street poslato Jun 29, 2011, 11:50:46 PRE PODNE
Eror:error 029: invalid expression, assumed zero
Warning:warning 204: symbol is assigned a value that is never used: "playa"
ta vrijednost nije uopce koristena ili je moras negdje koristiti ili delete.

daj liniju na kojoj ti izbaci taj error

Evo cijela komanda izbacuje na linijama oznacenim crvenom bojom....   
if(strcmp(cmd, "/news", true) == 0)
   {
       if(IsPlayerConnected(playerid))
       {
         if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9)
         {
              if(PlayerInfo[playerid][pMuted] == 1)
            {
               SendClientMessage(playerid, TEAM_CYAN_COLOR, "You cannot speak, you have been silenced");
               return 1;
            }
         new newcar = GetPlayerVehicleID(playerid);
         new playa;
        playa = ReturnUser(tmp);
         if(IsAcnnauto(newcar))
             {

               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_GREY, "Koristi: /news [newstext]");
                  return 1;
               }
               new rtext[64];
               if(PlayerInfo[playerid][pRank] == 1) { rtext = "Mladi Novinar"; }
               else if(PlayerInfo[playerid][pRank] == 2) { rtext = "Novinar"; }
               else if(PlayerInfo[playerid][pRank] == 3) { rtext = "Reporter"; }
               else if(PlayerInfo[playerid][pRank] == 4) { rtext = "Stariji Novinar"; }
               else if(PlayerInfo[playerid][pRank] == 5) { rtext = "Urednik"; }
                else if(PlayerInfo[playerid][pRank] == 6) { rtext = "Glavni Urednik"; }
               else { rtext = "Intern Worker"; }
               format(string, sizeof(string), "Vijesti | %s %s |: %s", rtext, sendername, result);
               OOCNews(COLOR_ORANGE,string);
               PlayerInfo[playerid][pNewsSkill] ++;
               if(PlayerInfo[playerid][pNewsSkill] == 50)
               { SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 2, soon you are able to Fly the News Chopper and talk Live."); }
               else if(PlayerInfo[playerid][pNewsSkill] == 100)
               { SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 3, soon you are able to Fly the News Chopper and talk Live."); }
               else if(PlayerInfo[playerid][pNewsSkill] == 200)
               { SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 4, you can fly the News Chopper now."); }
               else if(PlayerInfo[playerid][pNewsSkill] == 400)
               { SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 5, you can now talk Live with any person you want."); }
            }
         }
         else
         {
             SendClientMessage(playerid, COLOR_GREY, "   You are not a News Reporter !");
         }
         else
         {
             SendClientMessage(playerid, COLOR_GREY, "   Nisi u vozilu CNN-a");
         }
      }//not connected
      return 1;
   }
Trazim "Profesionalnog Skriptera" da mi napravi jednu stvar,cijena nebitna nek mi se javi na pm....trazim lika koji zna raditi ne nekog pocetnika

if(strcmp(cmd, "/news", true) == 0)
   {
       if(IsPlayerConnected(playerid))
       {
         if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9)
         {
              if(PlayerInfo[playerid][pMuted] == 1)
            {
               SendClientMessage(playerid, TEAM_CYAN_COLOR, "You cannot speak, you have been silenced");
               return 1;
            }
         new newcar = GetPlayerVehicleID(playerid);
         if(IsAcnnauto(newcar))
             {

               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_GREY, "Koristi: /news [newstext]");
                  return 1;
               }
               new rtext[64];
               if(PlayerInfo[playerid][pRank] == 1) { rtext = "Mladi Novinar"; }
               else if(PlayerInfo[playerid][pRank] == 2) { rtext = "Novinar"; }
               else if(PlayerInfo[playerid][pRank] == 3) { rtext = "Reporter"; }
               else if(PlayerInfo[playerid][pRank] == 4) { rtext = "Stariji Novinar"; }
               else if(PlayerInfo[playerid][pRank] == 5) { rtext = "Urednik"; }
                else if(PlayerInfo[playerid][pRank] == 6) { rtext = "Glavni Urednik"; }
               else { rtext = "Intern Worker"; }
               format(string, sizeof(string), "Vijesti | %s %s |: %s", rtext, sendername, result);
               OOCNews(COLOR_ORANGE,string);
               PlayerInfo[playerid][pNewsSkill] ++;
               if(PlayerInfo[playerid][pNewsSkill] == 50)
               { SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 2, soon you are able to Fly the News Chopper and talk Live."); }
               else if(PlayerInfo[playerid][pNewsSkill] == 100)
               { SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 3, soon you are able to Fly the News Chopper and talk Live."); }
               else if(PlayerInfo[playerid][pNewsSkill] == 200)
               { SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 4, you can fly the News Chopper now."); }
               else if(PlayerInfo[playerid][pNewsSkill] == 400)
               { SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 5, you can now talk Live with any person you want."); }
            }
         }
         else
         {
             SendClientMessage(playerid, COLOR_GREY, "   You are not a News Reporter !");
         }
         else
         {
             SendClientMessage(playerid, COLOR_GREY, "   Nisi u vozilu CNN-a");
         }
      }//not connected
      return 1;
   }