Szerző Téma: Pawno warning 209  (Megtekintve 2460 alkalommal)

Pawno warning 209
« Dátum: 2011. április 29. - 15:41:43 »
0 Show voters
Sziasztok!
Az a problémám hogy itt ez a kód: (nem én irtam).
[pawn]public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(\"/motor-be\", cmdtext, true, 10) == 0)
  {
      SendClientMessage(playerid, COLOR_GREEN, \"Beindítottad a motort!\");
      GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
      SetVehicleParamsEx(GetPlayerVehicleID(playerid), ON, lights, alarm, doors, bonnet, boot, objective);
  return 1;
  }
if(strcmp(\"/motor-ki\", cmdtext, true, 10) == 0)
  {
      SendClientMessage(playerid, COLOR_RED, \"Leállítottad a motort!\");
      GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
      SetVehicleParamsEx(GetPlayerVehicleID(playerid), OFF, lights, alarm, doors, bonnet, boot, objective);
  return 1;
  }
if(strcmp(\"/lámpa-be\", cmdtext, true, 10) == 0)
  {
      SendClientMessage(playerid, COLOR_GREEN, \"Bekapcsoltad a lámpát!\");
      GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
      SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, ON, alarm, doors, bonnet, boot, objective);
  return 1;
  }
if(strcmp(\"/lámpa-ki\", cmdtext, true, 10) == 0)
  {
      SendClientMessage(playerid, COLOR_RED, \"Kikapcsoltad a lámpát!\");
      GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
      SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, OFF, alarm, doors, bonnet, boot, objective);
  return 1;
  }
if(strcmp(\"/riasztó-be\", cmdtext, true, 10) == 0)
  {
      SendClientMessage(playerid, COLOR_GREEN, \"Bekapcsoltad a riasztót!\");
      GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
      SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, ON, doors, bonnet, boot, objective);
  return 1;
  }
if(strcmp(\"/riasztó-ki\", cmdtext, true, 10) == 0)
  {
      SendClientMessage(playerid, COLOR_RED, \"Kikapcsoltad a riasztót!\");
      GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
      SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, OFF, doors, bonnet, boot, objective);
  return 1;
  }
if(strcmp(\"/ajtók-nyit\", cmdtext, true, 10) == 0)
  {
      SendClientMessage(playerid, COLOR_GREEN, \"Kinyitottad az ajtókat!\");
      GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
      SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, ON, bonnet, boot, objective);
  return 1;
  }
if(strcmp(\"/ajtók-zár\", cmdtext, true, 10) == 0)
  {
      SendClientMessage(playerid, COLOR_RED, \"Bezártad az ajtókat!\");
      GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
      SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, OFF, bonnet, boot, objective);
  return 1;
  }
if(strcmp(\"/mh-nyit\", cmdtext, true, 10) == 0)
  {
      SendClientMessage(playerid, COLOR_GREEN, \"Felnyitottad a motorháztetõt!\");
      GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
      SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, ON, boot, objective);
  return 1;
  }
if(strcmp(\"/mh-zár\", cmdtext, true, 10) == 0)
  {
      SendClientMessage(playerid, COLOR_RED, \"Lecsuktad a motorháztetõt!\");
      GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
      SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, OFF, boot, objective);
  return 1;
  }
if(strcmp(\"/cst-nyit\", cmdtext, true, 10) == 0)
  {
      SendClientMessage(playerid, COLOR_GREEN, \"Kinyitottad a csomagtartót!\");
      GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
      SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, ON, objective);
  return 1;
  }
if(strcmp(\"/cst-zár\", cmdtext, true, 10) == 0)
  {
      SendClientMessage(playerid, COLOR_RED, \"Bezártad a csomagtartót!\");
      GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
      SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, OFF, objective);
  return 1;
  }
}[/pawn]
Hibakód:
kocsik.pwn(107) : warning 209: function \"OnPlayerCommandText\" should return a value

 
Olvastam utána, azt irják akkor hozza ki ezt ha valamit nem zár le az ember, de minden le van zárva, így nem tudom mi lehet a gond. Köszönöm a segítséget! ;D

Pawno warning 209
« Válasz #1 Dátum: 2011. április 29. - 15:42:45 »
0 Show voters
[pawn]kocsik.pwn(107) : warning 209: function \"OnPlayerCommandText\" should return a value[/pawn]
Az OnPlayerCommandText callback is vissza kell térjen egy értékkel...
Itt van :
[pawn]return 1;[/pawn]
Így azt hiszem jó kell legyen:
 
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(\"/motor-be\", cmdtext, true, 10) == 0)
  {
      SendClientMessage(playerid, COLOR_GREEN, \"Beindítottad a motort!\");
      GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
      SetVehicleParamsEx(GetPlayerVehicleID(playerid), ON, lights, alarm, doors, bonnet, boot, objective);
  return 1;
  }
if(strcmp(\"/motor-ki\", cmdtext, true, 10) == 0)
  {
      SendClientMessage(playerid, COLOR_RED, \"Leállítottad a motort!\");
      GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
      SetVehicleParamsEx(GetPlayerVehicleID(playerid), OFF, lights, alarm, doors, bonnet, boot, objective);
  return 1;
  }
if(strcmp(\"/lámpa-be\", cmdtext, true, 10) == 0)
  {
      SendClientMessage(playerid, COLOR_GREEN, \"Bekapcsoltad a lámpát!\");
      GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
      SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, ON, alarm, doors, bonnet, boot, objective);
  return 1;
  }
if(strcmp(\"/lámpa-ki\", cmdtext, true, 10) == 0)
  {
      SendClientMessage(playerid, COLOR_RED, \"Kikapcsoltad a lámpát!\");
      GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
      SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, OFF, alarm, doors, bonnet, boot, objective);
  return 1;
  }
if(strcmp(\"/riasztó-be\", cmdtext, true, 10) == 0)
  {
      SendClientMessage(playerid, COLOR_GREEN, \"Bekapcsoltad a riasztót!\");
      GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
      SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, ON, doors, bonnet, boot, objective);
  return 1;
  }
if(strcmp(\"/riasztó-ki\", cmdtext, true, 10) == 0)
  {
      SendClientMessage(playerid, COLOR_RED, \"Kikapcsoltad a riasztót!\");
      GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
      SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, OFF, doors, bonnet, boot, objective);
  return 1;
  }
if(strcmp(\"/ajtók-nyit\", cmdtext, true, 10) == 0)
  {
      SendClientMessage(playerid, COLOR_GREEN, \"Kinyitottad az ajtókat!\");
      GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
      SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, ON, bonnet, boot, objective);
  return 1;
  }
if(strcmp(\"/ajtók-zár\", cmdtext, true, 10) == 0)
  {
      SendClientMessage(playerid, COLOR_RED, \"Bezártad az ajtókat!\");
      GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
      SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, OFF, bonnet, boot, objective);
  return 1;
  }
if(strcmp(\"/mh-nyit\", cmdtext, true, 10) == 0)
  {
      SendClientMessage(playerid, COLOR_GREEN, \"Felnyitottad a motorháztetõt!\");
      GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
      SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, ON, boot, objective);
  return 1;
  }
if(strcmp(\"/mh-zár\", cmdtext, true, 10) == 0)
  {
      SendClientMessage(playerid, COLOR_RED, \"Lecsuktad a motorháztetõt!\");
      GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
      SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, OFF, boot, objective);
  return 1;
  }
if(strcmp(\"/cst-nyit\", cmdtext, true, 10) == 0)
  {
      SendClientMessage(playerid, COLOR_GREEN, \"Kinyitottad a csomagtartót!\");
      GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
      SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, ON, objective);
  return 1;
  }
if(strcmp(\"/cst-zár\", cmdtext, true, 10) == 0)
  {
      SendClientMessage(playerid, COLOR_RED, \"Bezártad a csomagtartót!\");
      GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
      SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, OFF, objective);
  return 1;
  }
return 1;
}
« Utoljára szerkesztve: 2011. április 29. - 15:51:45 írta horike13 »

Pawno warning 209
« Válasz #2 Dátum: 2011. április 29. - 15:51:47 »
0 Show voters
Így:
[pawn]if(strcmp(\"/cst-zár\", cmdtext, true, 10) == 0)
  {
      SendClientMessage(playerid, COLOR_RED, \"Bezártad a csomagtartót!\");
      GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
      SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, OFF, objective);
  return 1;
  }
return 1;
}[/pawn] (Ez az utolsó parancs, csak azért tettem ide hogy érthetõbb legyen.)

Pawno warning 209
« Válasz #3 Dátum: 2011. április 29. - 15:53:03 »
0 Show voters
Aha csak én az egészet beírtam :D

Nem elérhető ►ѕтa

  • 2016
  • Newbie
    • Profil megtekintése
Pawno warning 209
« Válasz #4 Dátum: 2011. április 29. - 15:54:41 »
0 Show voters
[pawn]
public OnPlayerCommandText(playerid, cmdtext[ ])
{
if(strcmp(\"/motor-be\", cmdtext, true))
{
   SendClientMessage(playerid, COLOR_GREEN, \"Beindítottad a motort!\");
   GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
   SetVehicleParamsEx(GetPlayerVehicleID(playerid), ON, lights, alarm, doors, bonnet, boot, objective);
   return 1;
}
if(strcmp(\"/motor-ki\", cmdtext, true))
{
           SendClientMessage(playerid, COLOR_RED, \"Leállítottad a motort!\");
           GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
            SetVehicleParamsEx(GetPlayerVehicleID(playerid), OFF, lights, alarm, doors, bonnet, boot, objective);
   return 1;
}
if(strcmp(\"/lámpa-be\", cmdtext, true))
{
           SendClientMessage(playerid, COLOR_GREEN, \"Bekapcsoltad a lámpát!\");
   GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
   SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, ON, alarm, doors, bonnet, boot, objective);
   return 1;
}
if(strcmp(\"/lámpa-ki\", cmdtext, true))
{
   SendClientMessage(playerid, COLOR_RED, \"Kikapcsoltad a lámpát!\");
   GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
   SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, OFF, alarm, doors, bonnet, boot, objective);
   return 1;
}
if(strcmp(\"/riasztó-be\", cmdtext, true))
{
   SendClientMessage(playerid, COLOR_GREEN, \"Bekapcsoltad a riasztót!\");
   GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
   SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, ON, doors, bonnet, boot, objective);
   return 1;
}
if(strcmp(\"/riasztó-ki\", cmdtext, true))
{
   SendClientMessage(playerid, COLOR_RED, \"Kikapcsoltad a riasztót!\");
   GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
   SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, OFF, doors, bonnet, boot, objective);
   return 1;
}
if(strcmp(\"/ajtók-nyit\", cmdtext, true))
{
   SendClientMessage(playerid, COLOR_GREEN, \"Kinyitottad az ajtókat!\");
   GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
   SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, ON, bonnet, boot, objective);
   return 1;
}
if(strcmp(\"/ajtók-zár\", cmdtext, true))
{
   SendClientMessage(playerid, COLOR_RED, \"Bezártad az ajtókat!\");
   GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
   SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, OFF, bonnet, boot, objective);
   return 1;
}
if(strcmp(\"/mh-nyit\", cmdtext, true))
{
   SendClientMessage(playerid, COLOR_GREEN, \"Felnyitottad a motorháztetõt!\");
   GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
   SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, ON, boot, objective);
   return 1;
}
if(strcmp(\"/mh-zár\", cmdtext, true))
{
   SendClientMessage(playerid, COLOR_RED, \"Lecsuktad a motorháztetõt!\");
   GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
   SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, OFF, boot, objective);
   return 1;
}
if(strcmp(\"/cst-nyit\", cmdtext, true))
{
   SendClientMessage(playerid, COLOR_GREEN, \"Kinyitottad a csomagtartót!\");
   GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
   SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, ON, objective);
   return 1;
}
if(strcmp(\"/cst-zár\", cmdtext, true))
{
   SendClientMessage(playerid, COLOR_RED, \"Bezártad a csomagtartót!\");
   GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
   SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, OFF, objective);
   return 1;
}
return 0;
}[/pawn]

Pawno warning 209
« Válasz #5 Dátum: 2011. április 29. - 15:56:38 »
0 Show voters
Oké. Köszi, mûködik! Zárok!  ;D

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal