Jump to content
  • 0

(3 WARNINGURI)[NPC]Nu recunoaste Comanda ConnectNPC:|


NeO

Question

bUNA,am facut ca in tutorialul lui cmg4life ,DESPRE ADAUGAREA UNUI NPC SI la  linia

[table][tr][td]public OnGameModeInit()

{

//npc VitezomanulNPC[/table]

imi da eroarea asta :

[table][tr][td]C:\Locker\sa-mp scripting\Tutos StuntDM!!!\Tutos StuntDM\rominpc.pwn(2297) : error 017: undefined symbol "ConnectNPC"

C:\Locker\sa-mp scripting\Tutos StuntDM!!!\Tutos StuntDM\rominpc.pwn(2302) : warning 225: unreachable code

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

1 Error.[/table] ,ADICA NU IMI RECUNOASTE COMANDA CONNECTNPC

SI VA ARAT SI LINIILE ASTEA:  

[table][tr][td]}

public OnGameModeInit()

{

   

 ConnectNPC("VitezomanulNPC","VitezomanulNPC");

   return 1;

//sfarsitul npcului :)

SetGameModeText("Romania.:->Stunt+DM+DRIFT");

SetWeather(2);

AllowInteriorWeapons(1);

SetWorldTime(13);

...[...][/table]

si !!! am pus include-ul

uitati aici::)

[table][tr][td]#include <a_npc>[/table],dar degeaba ca numi cunoaste:((:(

va rog ajutatima si ,am si scriptul gl_npc,care contine:

//-------------------------------------------------

//

//  NPC initialisation for Grand Larceny

//

//-------------------------------------------------

#pragma tabsize 0

#include <a_samp>

#include <npc>

//-------------------------------------------------

public OnFilterScriptInit()

{

ConnectNPC("TrainDriverLV","train_lv");

ConnectNPC("TrainDriverLS","train_ls");

ConnectNPC("TrainDriverSF","train_sf");

ConnectNPC("PilotLV","at400_lv");

ConnectNPC("PilotSF","at400_sf");

ConnectNPC("PilotLS","at400_ls");

// Testing

//ConnectNPC("TestIdle","onfoot_test");

//ConnectNPC("TaxiTest","mat_test");

return 1;

}

//-------------------------------------------------

// IMPORTANT: This restricts NPCs connecting from

// an IP address outside this server. If you need

// to connect NPCs externally you will need to modify

// the code in this callback.

public OnPlayerConnect(playerid)

{

if(IsPlayerNPC(playerid)) {

   new ip_addr_npc[64+1];

   new ip_addr_server[64+1];

   GetServerVarAsString("bind",ip_addr_server,64);

   GetPlayerIp(playerid,ip_addr_npc,64);

   

if(!strlen(ip_addr_server)) {

   ip_addr_server = "127.0.0.1";

}

if(strcmp(ip_addr_npc,ip_addr_server,true) != 0) {

   // this bot is remote connecting

   printf("NPC: Got a remote NPC connecting from %s and I'm kicking it.",ip_addr_npc);

   Kick(playerid);

   return 0;

}

       printf("NPC: Connection from %s is allowed.",ip_addr_npc);

}

return 1;

}

//-------------------------------------------------

public OnPlayerRequestClass(playerid, classid)

{

if(!IsPlayerNPC(playerid)) return 0; // We only deal with NPC players in this script

new playername[64];

GetPlayerName(playerid,playername,64);

if(!strcmp(playername,"TrainDriverLV",true)) {

       SetSpawnInfo(playerid,69,255,1462.0745,2630.8787,10.8203,0.0,-1,-1,-1,-1,-1,-1);

}

else if(!strcmp(playername,"TrainDriverSF",true)) {

   SetSpawnInfo(playerid,69,255,-1942.7950,168.4164,27.0006,0.0,-1,-1,-1,-1,-1,-1);

}

else if(!strcmp(playername,"TrainDriverLS",true)) {

   SetSpawnInfo(playerid,69,255,1700.7551,-1953.6531,14.8756,0.0,-1,-1,-1,-1,-1,-1);

}

else if(!strcmp(playername,"PilotLV",true)) {

   SetSpawnInfo(playerid,69,61,0.0,0.0,0.0,0.0,-1,-1,-1,-1,-1,-1);

}

else if(!strcmp(playername,"PilotSF",true)) {

   SetSpawnInfo(playerid,69,61,0.0,0.0,0.0,0.0,-1,-1,-1,-1,-1,-1);

}

else if(!strcmp(playername,"PilotLS",true)) {

   SetSpawnInfo(playerid,69,61,0.0,0.0,0.0,0.0,-1,-1,-1,-1,-1,-1);

}

else if(!strcmp(playername,"TestIdleDriver",true)) {

   SetSpawnInfo(playerid,69,61,0.0,0.0,0.0,0.0,-1,-1,-1,-1,-1,-1);

}

else if(!strcmp(playername,"TaxiTest",true)) {

   SetSpawnInfo(playerid,69,61,0.0,0.0,0.0,0.0,-1,-1,-1,-1,-1,-1);

}

return 0;

}

//-------------------------------------------------

public OnPlayerSpawn(playerid)

{

if(!IsPlayerNPC(playerid)) return 1; // We only deal with NPC players in this script

new playername[64];

GetPlayerName(playerid,playername,64);

if(!strcmp(playername,"TrainDriverLV",true)) {

       PutPlayerInVehicle(playerid,1,0);

       SetPlayerColor(playerid,0xFFFFFFFF);

}

else if(!strcmp(playername,"TrainDriverSF",true)) {

   PutPlayerInVehicle(playerid,5,0);

   SetPlayerColor(playerid,0xFFFFFFFF);

}

else if(!strcmp(playername,"TrainDriverLS",true)) {

   PutPlayerInVehicle(playerid,9,0);

   SetPlayerColor(playerid,0xFFFFFFFF);

}

else if(!strcmp(playername,"PilotLV",true)) {

   PutPlayerInVehicle(playerid,13,0);

   SetPlayerColor(playerid,0xFFFFFFFF);

}

else if(!strcmp(playername,"PilotSF",true)) {

   PutPlayerInVehicle(playerid,14,0);

   SetPlayerColor(playerid,0xFFFFFFFF);

}

else if(!strcmp(playername,"PilotLS",true)) {

   PutPlayerInVehicle(playerid,15,0);

   SetPlayerColor(playerid,0xFFFFFFFF);

}

else if(!strcmp(playername,"TestIdleDriver",true)) {

   PutPlayerInVehicle(playerid,43,0);

   SetPlayerColor(playerid,0xFFFFFFFF);

}

else if(!strcmp(playername,"TaxiTest",true)) {

   PutPlayerInVehicle(playerid,968,0);

   SetPlayerColor(playerid,0xFFFFFFFF);

}

return 1;

}

//-------------------------------------------------

// EOF

si aicia ,daca dau COMPILE fara sa modfiC ABSOLUT nimic imi da tot acea eroare "StuntDM\rominpc.pwn(2297) : error 017: undefined symbol "ConnectNPC"" , nu mil gaseste,oare incul nu este bun? daca aveti acest inc va rog punetil aici daca vreti

multumesc pt ajutor:)

Va rog :) chiar vreau npc...sa se plimbe...ahh..

Sper sa ma ajutati VAAA ROOOG

qdbjz10.png

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

Guest Asasi

La are prima care spui tu ca nu cunoaste npc :)) este  ca nu ai definit simbolul new ConnectNPC;

bagal la new la tine acolo si  vezi daca merge

Link to comment
Share on other sites

ia uite ce face daca pun asa:  :P

C:\Locker\sa-mp scripting\super stunt server By NeO V. [0 3 . a]\pawno\include\Sinclude.inc(210) : warning 219: local variable "Interior" shadows a variable at a preceding level

C:\Locker\sa-mp scripting\super stunt server By NeO V. [0 3 . a]\gamemodes\RO203.pwn(2355) : error 012: invalid function call, not a valid address

C:\Locker\sa-mp scripting\super stunt server By NeO V. [0 3 . a]\gamemodes\RO203.pwn(2355) : warning 215: expression has no effect

C:\Locker\sa-mp scripting\super stunt server By NeO V. [0 3 . a]\gamemodes\RO203.pwn(2355) : warning 215: expression has no effect

C:\Locker\sa-mp scripting\super stunt server By NeO V. [0 3 . a]\gamemodes\RO203.pwn(2355) : error 001: expected token: ";", but found ")"

C:\Locker\sa-mp scripting\super stunt server By NeO V. [0 3 . a]\gamemodes\RO203.pwn(2355) : error 029: invalid expression, assumed zero

C:\Locker\sa-mp scripting\super stunt server By NeO V. [0 3 . a]\gamemodes\RO203.pwn(2355) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

4 Errors.

si liniile :

//------------------------------------------------------------------------------------------------------

new ConnectNPC;

new iSpawnSet[MAX_PLAYERS];

si linia asta:

ConnectNPC("Sweet", "sweetgrov");

deci........

qdbjz10.png

Link to comment
Share on other sites

Si .....care este acel include ? :D

Si dinalex :o:O tU erai ala care am jucat pe serverul ala de super stunt de la "Hoster" si ii injuram pe englezii aia?? :)) tu esti?????

asa te kema si in joc ,pe sv ala : dinalex ,, ma mai stii ? is neo ,si eu am fost pe sv atunci  ::):P

Deci este vreun include ..?cu aceasta functie???

ConnectNPC :|

si am pus include-ul a_npc :|

ALt include de NPC mai este?

qdbjz10.png

Link to comment
Share on other sites

Acum am facut ,si nu mai da eroare  :) ...

,dar da 4 warninguri (1 warning) dadea si inainte ,deci da 3 warninguri de la NPC

Dar nu merge

cum  sa mearga .... daca da warningurile  astea:

C:\Locker\sa-mp scripting\sa-mp server 03.a R7\pawno\include\SIncludes.inc(210) : warning 219: local variable "Interior" shadows a variable at a preceding level
C:\Locker\sa-mp scripting\sa-mp server 03.a R7\gamemodes\RO203.pwn(2415) : [b]warning 215: expression has no effect[/b]
C:\Locker\sa-mp scripting\sa-mp server 03.a R7\gamemodes\RO203.pwn(2412) :[b] warning 203: symbol is never used: "ConectNPC"[/b]
C:\Locker\sa-mp scripting\sa-mp server 03.a R7\gamemodes\RO203.pwn(5779) :[b] warning 203: symbol is never used: "IsPlayerNPC"[/b]
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


4 Warnings.
cele ingrosate is warningurile de la npc :| si liniile uite cum am facut::
public OnGameModeInit()
{
[b]new ConectNPC;
#define ConectNPC[/b]

[b]ConectNPC("sweet","sweet");[/b]
SetGameModeText("********* ******** ");

dar am pus si aia cu [code]if(IsPlayerNPC(playerid)) return 1;
deci ......aproape rezolvat,trebuie sa scap de acele warninguri ...... dar daca as pune npcul intrun fs .... oare ar merge? ??? ca acuma is in gm .....ehh o sa incerc :P si cum scap de warningurile alea ca sa se conecteze npcul ? :| plss include
#include <a_samp>         //
#include <SIncludes>      //
#include <Dudb>
#include <dini>
#include <dudb>
#include <time>
#include <a_npc>     //

qdbjz10.png

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.