29.11.2009, 09:36
Hey guys,im new to this,i got many errors on the gamemode script so i just created a filterscript.
I still get errors lol can anyone help?
BOT is the filename.
Errors:
Can anyone fix it and post it or just help me?thanks very much!
I still get errors lol can anyone help?
Code:
public OnFilterScriptInit() { print("my filterscript"); ConnectNPC("MyFirstNPC","BOT"); return 1; } new MyFirstNPCVehicle; //Global variable! public OnFilterScriptInit() { print("my filterscript"); ConnectNPC("MyFirstNPC","BOT"); MyFirstNPCVehicle = CreateVehicle(400, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000); return 1; } public OnPlayerSpawn(playerid) { if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC. { new npcname[MAX_PLAYER_NAME]; GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC's name. if(!strcmp(npcname, "MyFirstNPC", true)) //Checking if the NPC's name is MyFirstNPC { PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 0); //Putting the NPC into the vehicle we created for it. } return 1; } //Other stuff for normal players goes here! return 1; }
Errors:
Code:
C:\Program Files\gta.sa\GTA San Andreas\filterscripts\npc_test_2.pwn(1) : warning 235: public function lacks forward declaration (symbol "OnFilterScriptInit") C:\Program Files\gta.sa\GTA San Andreas\filterscripts\npc_test_2.pwn(3) : error 017: undefined symbol "print" C:\Program Files\gta.sa\GTA San Andreas\filterscripts\npc_test_2.pwn(4) : error 017: undefined symbol "ConnectNPC" C:\Program Files\gta.sa\GTA San Andreas\filterscripts\npc_test_2.pwn(9) : warning 235: public function lacks forward declaration (symbol "OnFilterScriptInit") C:\Program Files\gta.sa\GTA San Andreas\filterscripts\npc_test_2.pwn(10) : error 021: symbol already defined: "OnFilterScriptInit" C:\Program Files\gta.sa\GTA San Andreas\filterscripts\npc_test_2.pwn(11) : error 017: undefined symbol "print" C:\Program Files\gta.sa\GTA San Andreas\filterscripts\npc_test_2.pwn(12) : error 017: undefined symbol "ConnectNPC" C:\Program Files\gta.sa\GTA San Andreas\filterscripts\npc_test_2.pwn(13) : error 017: undefined symbol "CreateVehicle" C:\Program Files\gta.sa\GTA San Andreas\filterscripts\npc_test_2.pwn(17) : warning 235: public function lacks forward declaration (symbol "OnPlayerSpawn") C:\Program Files\gta.sa\GTA San Andreas\filterscripts\npc_test_2.pwn(19) : error 017: undefined symbol "IsPlayerNPC" C:\Program Files\gta.sa\GTA San Andreas\filterscripts\npc_test_2.pwn(21) : error 017: undefined symbol "MAX_PLAYER_NAME" C:\Program Files\gta.sa\GTA San Andreas\filterscripts\npc_test_2.pwn(21) : error 009: invalid array size (negative, zero or out of bounds) C:\Program Files\gta.sa\GTA San Andreas\filterscripts\npc_test_2.pwn(21) : error 036: empty statement C:\Program Files\gta.sa\GTA San Andreas\filterscripts\npc_test_2.pwn(21) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase