17.11.2010, 15:33
I get this error, followed the tutorial exactly (atleast i think so) :P
C:\Users\fysical\Desktop\samp03bsvr_R2_win32\gamem odes\JimmysDeathMatch.pwn(55) : error 017: undefined symbol "Cars"
C:\Users\fysical\Desktop\samp03bsvr_R2_win32\gamem odes\JimmysDeathMatch.pwn(55) : error 017: undefined symbol "Soa"
C:\Users\fysical\Desktop\samp03bsvr_R2_win32\gamem odes\JimmysDeathMatch.pwn(55) : error 029: invalid expression, assumed zero
C:\Users\fysical\Desktop\samp03bsvr_R2_win32\gamem odes\JimmysDeathMatch.pwn(55) : fatal error 107: too many error messages on one line
Here's my code
C:\Users\fysical\Desktop\samp03bsvr_R2_win32\gamem odes\JimmysDeathMatch.pwn(55) : error 017: undefined symbol "Cars"
C:\Users\fysical\Desktop\samp03bsvr_R2_win32\gamem odes\JimmysDeathMatch.pwn(55) : error 017: undefined symbol "Soa"
C:\Users\fysical\Desktop\samp03bsvr_R2_win32\gamem odes\JimmysDeathMatch.pwn(55) : error 029: invalid expression, assumed zero
C:\Users\fysical\Desktop\samp03bsvr_R2_win32\gamem odes\JimmysDeathMatch.pwn(55) : fatal error 107: too many error messages on one line
Here's my code
Code:
// This is a comment // uncomment the line below if you want to write a filterscript //#define FILTERSCRIPT #include <a_samp> #if defined FILTERSCRIPT #include <streamer> #include <sscanf2> #define COLOR_RED 0xFF0000AA #define SOA 1 #define LSPD 2 #define SOA_COLOUR 0x00820FAA #define LSPD_COLOUR 0x003DF5AA //kod som gцr sе att bara polis kan gе in i polisbil o soa bara kan gе i soa bike. enum TeamCars { Soa, Lspd } new Cars[TeamCars]; new gTeam[MAX_PLAYERS]; public OnFilterScriptInit() { print("\n--------------------------------------"); print(" Jimmy Karlsson"); print("--------------------------------------\n"); return 1; } public OnFilterScriptExit() { return 1; } #else main() { print("\n----------------------------------"); print(" JimmysDeathmatch"); print("----------------------------------\n"); } #endif public OnGameModeInit() { //Hдr lдgger man till nya skins. // Don't use these lines if it's a filterscript //SOA BIKES Cars[Soa] = CreateVehicle(463,694.8014,-474.0371,15.8537,90.5883,25,1); //Bikes Cars[Soa] = CreateVehicle(463,694.6365,-472.5578,15.8562,91.6353,32,1); //Bikes Cars[Soa] = CreateVehicle(463,694.5961,-470.9783,15.8557,88.3544,122,1); //Bikes Cars[Soa] = CreateVehicle(586,694.7456,-469.3488,15.8561,90.8062,10,1); //Bikes Cars[Soa] = CreateVehicle(586,694.7992,-467.5677,15.8553,87.6643,25,1); //Bikes //LSPD CAR Cars[Lspd] = CreateVehicle(597,1557.6084,-1607.4335,13.1503,3.6478,0,1); //LSPD Cruiser return 1; SetGameModeText("JimmysDeathmatch"); //SOA AddPlayerClass(247, 1545.7916,-1675.6432,13.5611,92.1874,0,0,0,0,0,0); AddPlayerClass(248,1545.7916,-1675.6432,13.5611,92.1874,0,0,0,0,0,0); //LSPD AddPlayerClass(280, 1545.7916,-1675.6432,13.5611,92.1874,0,0,0,0,0,0); AddPlayerClass(281,1545.7916,-1675.6432,13.5611,92.1874,0,0,0,0,0,0); return 1; } public OnGameModeExit() { return 1; } //Hдr har jag gjt sе att positionen дr vid polisstation //Camerapositionen tittar pе skinnens //Cameralookat tittar pе skinnens public OnPlayerRequestClass(playerid, classid) { SetPlayerTeamFromClass(playerid, classid); //gцr sе classen дndras till ett team! GivePlayerMoney(playerid, 15000); //han fеr 15000kr nдr han spawnar SetPlayerPos(playerid, 1483.5361,-1713.5564,14.0469); SetPlayerFacingAngle(playerid, 181.8816); SetPlayerCameraPos(playerid, 1483.4851,-1704.9474,14.0469); SetPlayerCameraLookAt(playerid, 1483.5361,-1713.5564,14.0469); return 1; } //Allt detta sker nдr nеgon connectar public OnPlayerConnect(playerid) { new string[256]; new playername[MAX_PLAYER_NAME]; GetPlayerName(playerid,playername,sizeof(playername));//denna koden sдger till scriptet att ta personen som connectars player name =) format(string, sizeof(string), "Welcome to the server %s fore tutorials and stuff visit http://random.com",playername); SendClientMessage(playerid,0xAA3333AA,string); //Stringen gцr sе det i stringen цver return 1; } public OnPlayerDisconnect(playerid, reason) { return 1; } public OnPlayerSpawn(playerid) { SetPlayerToTeamColor(playerid); //Nдr dom vдljer skin sе ska rдtt nametag o color vдljas det lцser den hдr. return 1; } public OnPlayerDeath(playerid, killerid, reason) { SendClientMessage(killerid,0xAA3333AA,"You murdered a man, and also stole his wallet with 500$ in it, hope no one saw you!");//Om du mцrdar nеgon fеr du detta meddelandet GivePlayerMoney(killerid, 500); //om man mцrdar nеgon fеr man 500$ (du rеnar han RP int ekommit sе lеngt дn ;) ) SendClientMessage(playerid,0xAA3333AA,"You were murdered and robbed for 500$, watch out next time!"); //om du blir mцrdad fеr du detta meddelandet GivePlayerMoney(playerid, -500);//om man dцr fцrlorar man 600 return 1; } public OnVehicleSpawn(vehicleid) { return 1; } public OnVehicleDeath(vehicleid, killerid) { return 1; } public OnPlayerText(playerid, text[]) { return 1; } //Hдr gцr jag kommands man kan anvдnda i spelet public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/kill", cmdtext, true, 10) == 0) { SetPlayerHealth(playerid, 0); return 1; } if (strcmp("/buymp5", cmdtext, true, 10) == 0) { GivePlayerWeapon(playerid, 29,200); GivePlayerMoney(playerid, -15000); //om du skriver /buymp5 sе "kцper" du en mp5 med 200 skott fцr 15000 return 1; } if (strcmp("/teleportspawn", cmdtext, true, 10) == 0) { SetPlayerPos(playerid, 1545.3984,-1675.6747,13.5603); //X, Y, Z return 1; } if (strcmp("/helpme", cmdtext, true, 10) == 0) { SendClientMessage(playerid,0xAA3333AA,"For all the commands/jobs/location etc go to http://random.com"); return 1; } if (strcmp("/teleport1", cmdtext, true, 10) == 0) { SetPlayerPos(playerid, 2442.7378,-1279.5771,24.0000); //X, Y, Z return 1; } //denna koden under gцr sе att jag kan spawna en bil, lite mera kompliserat if(strcmp("/admincar", cmdtext, true, 5) == 0){ new Float:x, Float:y, Float:z, Float:az; GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, az); CreateVehicle(429, x+5, y+5, z, az, -1, -1, 180); return 1; } return 0; } public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { return 1; } public OnPlayerExitVehicle(playerid, vehicleid) { return 1; } public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate == 2) { new CarCheck = GetPlayerVehicleID(playerid); if(CarCheck == Cars[Soa] ) { if(gTeam[playerid] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, COLOR_RED, "You Don't have the keys for this car!"); return 1; } } if(CarCheck == Cars[Lspd] ) { if(gTeam[playerid] != 2) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, COLOR_RED, "You Don't have the keys for this car!"); return 1; } } return 1; } return 1; } public OnPlayerEnterCheckpoint(playerid) { return 1; } public OnPlayerLeaveCheckpoint(playerid) { return 1; } public OnPlayerEnterRaceCheckpoint(playerid) { return 1; } public OnPlayerLeaveRaceCheckpoint(playerid) { return 1; } public OnRconCommand(cmd[]) { return 1; } public OnPlayerRequestSpawn(playerid) { return 1; } public OnObjectMoved(objectid) { return 1; } public OnPlayerObjectMoved(playerid, objectid) { return 1; } public OnPlayerPickUpPickup(playerid, pickupid) { return 1; } public OnVehicleMod(playerid, vehicleid, componentid) { return 1; } public OnVehiclePaintjob(playerid, vehicleid, paintjobid) { return 1; } public OnVehicleRespray(playerid, vehicleid, color1, color2) { return 1; } public OnPlayerSelectedMenuRow(playerid, row) { return 1; } public OnPlayerExitedMenu(playerid) { return 1; } public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid) { return 1; } public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { return 1; } public OnRconLoginAttempt(ip[], password[], success) { return 1; } public OnPlayerUpdate(playerid) { return 1; } public OnPlayerStreamIn(playerid, forplayerid) { return 1; } public OnPlayerStreamOut(playerid, forplayerid) { return 1; } public OnVehicleStreamIn(vehicleid, forplayerid) { return 1; } public OnVehicleStreamOut(vehicleid, forplayerid) { return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { return 1; } public OnPlayerClickPlayer(playerid, clickedplayerid, source) { return 1; } SetPlayerTeamFromClass(playerid, classid) { if(classid == 0) { gTeam[playerid] = SOA; } if(classid == 1) { gTeam[playerid] = LSPD; } } SetPlayerToTeamColour(playerid) { if(gTeam[playerid] == SOA) { SetPlayerColor(playerid,SOA_COLOUR); //Green } if(gTeam[playerid] == LSPD) { SetPlayerColor(playerid,LSPD_COLOUR); // Blue } }