Morph1 Geplaatst: 18 mei 2009 Rapport Geplaatst: 18 mei 2009 hallo, ik heb een server gemaakt, maar ik heb 9 errors, ik heb geen flauw idee hoe ik die kan verhelpen, wil mischien iemand mijn script ff fixen. hier is ie: #include <a_samp> #include <float> #include <core> new classid; new gTeam; #define TEAM_JONGEREN 1 // Team jongeren #define TEAM_SMERISEN 2 // Team smerisen #define COLOR_GREEN 0x32CD32AA // Kleur jongeren #define COLOR_BLUE 0x0000CDAA // Kleur smerisen #define COLOR_GREY 0xAFAFAFAA // Kleur wanneer je inactive bent //------------------------------------------------------------------------------ forward SetPlayerToTeamColor(playerid); // Speler naar teamkleur zetten forward SetupPlayerForClassSelection(playerid); // Speler klaarmaken voor setup forward SetPlayerTeamFromClass(playerid,classid); // Speler in team zetten forward ExitTheGameMode(); // uit gamemode gaan //------------------------------------------------------------------------------ public OnGameModeInit() { // Don't use these lines if it's a filterscript SetGameModeText("Airwar"); AddPlayerClass(67,1660.312,-2402.307,13.55469,134.7722,28,500,37,250,5,0); // jongeren 1 AddPlayerClass(115,1660.312,-2402.307,13.55469,134.7722,28,500,37,250,5,0);// jongeren 1 AddPlayerClass(170,1660.312,-2402.307,13.55469,134.7722,28,500,37,250,5,0); // jongeren 1 AddPlayerClass(280,1645.818,-2675.571,13.54688,330.6429,22,250,23,250,25,100); // smeris AddPlayerClass(281,1645.818,-2675.571,13.54688,330.6429,22,250,23,250,25,100); // smeris AddPlayerClass(284,1645.818,-2675.571,13.54688,330.6429,22,250,23,250,25,100); // smeris AddStaticVehicle(476,1796.8372,-2476.2964,14.2673,178.3301,89,91); // AddStaticVehicle(476,1783.2672,-2476.2642,14.2623,181.1099,103,102); // AddStaticVehicle(476,1771.3412,-2476.3823,14.2729,178.8508,71,77); // AddStaticVehicle(476,1758.2069,-2476.7354,14.2697,178.8175,7,6); // AddStaticVehicle(476,1746.1855,-2476.2761,14.2965,179.9581,71,77); // AddStaticVehicle(476,1734.3160,-2476.1763,14.2642,178.8368,7,6); // AddStaticVehicle(476,1722.0498,-2476.4106,14.2737,179.8360,71,77); // AddStaticVehicle(476,1709.5515,-2476.3210,14.2809,182.0177,7,6); // AddStaticVehicle(476,1696.7780,-2476.3201,14.2612,180.0188,71,77); // AddStaticVehicle(476,1685.2684,-2476.1899,14.2658,179.4795,89,91); // AddStaticVehicle(476,1672.4994,-2475.9961,14.2651,176.1573,7,6); // AddStaticVehicle(476,1660.0139,-2476.0527,14.2938,180.8458,71,77); // AddStaticVehicle(476,1647.6143,-2476.6177,14.2657,182.1340,89,91); // AddStaticVehicle(476,1636.1099,-2476.5342,14.2624,179.2340,7,6); // AddStaticVehicle(577,1433.3184,-2493.7463,13.4710,270.0286,8,10); // AddStaticVehicle(485,1448.1206,-2570.5955,13.2040,188.0168,1,77); // AddStaticVehicle(476,1543.5247,-2611.1943,14.2495,355.4034,6,7); // AddStaticVehicle(476,1557.3591,-2610.9236,14.2507,0.0384,89,91); // AddStaticVehicle(476,1570.4740,-2611.2544,14.2735,1.3837,103,102); // AddStaticVehicle(476,1582.1486,-2611.1697,14.2573,1.8149,71,77); // AddStaticVehicle(476,1596.1619,-2611.3086,14.2503,359.9931,7,6); // AddStaticVehicle(476,1609.3242,-2611.1287,14.2523,357.7919,89,91); // AddStaticVehicle(476,1622.7618,-2611.5640,14.2722,3.9697,103,102); // AddStaticVehicle(476,1637.1892,-2611.2649,14.2527,357.1283,71,77); // AddStaticVehicle(476,1650.5060,-2611.2571,14.2499,359.6149,7,6); // AddStaticVehicle(476,1662.8473,-2611.1250,14.2710,0.8926,89,91); // AddStaticVehicle(476,1675.7589,-2610.9846,14.2561,0.7057,103,102); // AddStaticVehicle(476,1688.6541,-2611.4038,14.2525,358.5987,71,77); // AddStaticVehicle(476,1702.0942,-2612.0305,14.2632,359.5744,7,6); // AddStaticVehicle(476,1715.8359,-2612.0088,14.2420,356.4739,89,91); // AddStaticVehicle(497,1943.3289,-2645.4976,13.7244,0.0011,0,1); // AddStaticVehicle(497,1956.4980,-2644.9470,13.7237,0.6498,0,1); // AddStaticVehicle(564,1969.6356,-2468.0806,12.7085,185.7075,0,0); // AddStaticVehicle(564,1964.7548,-2468.0852,12.7085,186.1145,0,0); // AddStaticVehicle(564,1959.8259,-2468.7590,12.7085,187.1175,0,0); // AddStaticVehicle(583,2061.5159,-2431.3315,13.0874,131.8745,1,1); // AddStaticVehicle(594,1666.8236,-2419.0300,12.7390,201.2130,0,0); // AddStaticVehicle(607,1496.3966,-2430.9326,13.6093,163.2427,0,0); // AddStaticVehicle(485,1454.7504,-2465.1226,13.2076,182.7222,1,79); // AddStaticVehicle(606,1556.2045,-2641.1638,13.5993,137.5406,0,0); // AddStaticVehicle(606,1649.6750,-2542.9236,17.2856,269.0840,0,0); // AddStaticVehicle(606,1649.6942,-2533.4072,17.2846,270.3615,0,0); // AddStaticVehicle(606,1650.0625,-2553.0283,17.2858,270.5369,0,0); // AddStaticVehicle(425,1957.4086,-2196.6865,14.1190,272.3766,43,0); // AddStaticVehicle(577,1445.9379,-2594.9373,13.4629,270.9230,8,16); // groot vliegtuig AddStaticVehicle(608,1454.7676,-2537.7104,14.0783,358.7568,1,1); // trappetje AddStaticVehicle(608,1458.4314,-2439.8789,14.0876,0.0000,1,1); // trappetje2 return 1; } //------------------------------------------------------------------------------ public OnPlayerConnect(playerid) { SetPlayerColor(playerid,COLOR_GREY); // Kleur GameTextForPlayer(playerid,"~g~jongeren ~w~vs ~b~smerissen!",2000,5); // Text return 1; //------------------------------------------------------------------------------ public SetupPlayerForClassSelection(playerid) { SetPlayerInterior(playerid,280); SetPlayerPos(playerid,1660.312,-2402.307,13.55469); SetPlayerCameraPos(playerid,1660.312,-2402.307,13.55469); SetPlayerCameraLookAt(playerid,1660.312,-2406.307,13.55469); SetPlayerFacingAngle(playerid,548.8462); } //------------------------------------------------------------------------------ public SetPlayerTeamFromClass(playerid,classid) { if(classid == 0 || classid == 1 || classid == 2) { gTeam[playerid] = JONGEREN; } else if(classid == 3 || classid == 4 || classid == 5) { gTeam[playerid] = SMERISSEN; } } //------------------------------------------------------------------------------ public SetPlayerToTeamColor(playerid) { if(gTeam[playerid] == TEAM_JONGEREN) { SetPlayerColor(playerid,COLOR_GREEN); // geel } else if(gTeam[playerid] == TEAM_SMERISSEN) { SetPlayerColor(playerid,COLOR_BLUE); // roze/paars } } //------------------------------------------------------------------------------ public OnPlayerRequestClass(playerid, classid) { SetupPlayerForClassSelection(playerid); SetPlayerTeamFromClass(playerid,classid); if(classid == 0 || classid == 1 || classid == 2) { GameTextForPlayer(playerid,"~g~Jongeren",1000,5); } else if(classid == 3 || classid == 4 || classid == 5) { GameTextForPlayer(playerid,”~b~Smerissen",1000,5); } return 1; } //------------------------------------------------------------------------------ public OnPlayerSpawn(playerid) { SetPlayerToTeamColor(playerid); SetPlayerInterior(playerid,0); if(gTeam[playerid] == TEAM_Jongeren) { GameTextForPlayer(playerid, "vermoord zoveel mogelijk ~b~Smerissen. maak gebruik van de vliegtuigen!" 6000,5); } else if(gTeam[playerid] == TEAM_Smerissen) { GameTextForPlayer(playerid, "vermoord zoveel mogelijk ~g~Jongeren, maak gebruik van de vliegtuigen!" 6000,5); } return 1; } //------------------------------------------------------------------------------ public ExitTheGameMode() { GameModeExit(); } //------------------------------------------------------------------------------ public OnPlayerDeath(playerid, killerid, reason) { new deathstr[256]; new whodiedname[MAX_PLAYER_NAME+1]; new whokilledname[MAX_PLAYER_NAME+1]; new deathreasonstr[256]; GetPlayerName(playerid,whodiedname,MAX_PLAYER_NAME); GetWeaponName(reason,deathreasonstr,255); if(killerid == INVALID_PLAYER_ID) { if(strlen(deathreasonstr)) { format(deathstr,256,"%s died (%s)",whodiedname,deathreasonstr); } else { format(deathstr,256,"%s died",whodiedname); } SendClientMessageToAll(OBJECTIVE_COLOR, deathstr); } else { GetPlayerName(killerid,whokilledname,MAX_PLAYER_NAME); if(gTeam[killerid] != gTeam[playerid]) { // Valid kill if(strlen(deathreasonstr)) { format(deathstr,256,"%s was killed by %s (%s)",whodiedname,whokilledname,deathreasonstr); } else { format(deathstr,256,"%s was killed by %s",whodiedname,whokilledname); } SendClientMessageToAll(OBJECTIVE_COLOR, deathstr); SetPlayerScore(killerid,GetPlayerScore(killerid)+1); } else { // Team kill format(deathstr,256,"%s killed team-mate %s (%s)",whokilledname,whodiedname,deathreasonstr); SendClientMessageToAll(OBJECTIVE_COLOR, deathstr); } } return 1; } en hier de errors : C:\Documents and Settings\Petra\Bureaublad\Server\gamemodes\airwar.pwn(89) : warning 225: unreachable code C:\Documents and Settings\Petra\Bureaublad\Server\gamemodes\airwar.pwn(89) : warning 217: loose indentation C:\Documents and Settings\Petra\Bureaublad\Server\gamemodes\airwar.pwn(89) : error 029: invalid expression, assumed zero C:\Documents and Settings\Petra\Bureaublad\Server\gamemodes\airwar.pwn(89) : error 004: function "SetupPlayerForClassSelection" is not implemented C:\Documents and Settings\Petra\Bureaublad\Server\gamemodes\airwar.pwn(93) : warning 217: loose indentation C:\Documents and Settings\Petra\Bureaublad\Server\gamemodes\airwar.pwn(94) : warning 217: loose indentation C:\Documents and Settings\Petra\Bureaublad\Server\gamemodes\airwar.pwn(98) : error 029: invalid expression, assumed zero C:\Documents and Settings\Petra\Bureaublad\Server\gamemodes\airwar.pwn(98) : error 004: function "SetPlayerTeamFromClass" is not implemented C:\Documents and Settings\Petra\Bureaublad\Server\gamemodes\airwar.pwn(101) : error 028: invalid subscript (not an array or too many subscripts): "gTeam" C:\Documents and Settings\Petra\Bureaublad\Server\gamemodes\airwar.pwn(101) : warning 215: expression has no effect C:\Documents and Settings\Petra\Bureaublad\Server\gamemodes\airwar.pwn(101) : error 001: expected token: ";", but found "]" C:\Documents and Settings\Petra\Bureaublad\Server\gamemodes\airwar.pwn(101) : error 029: invalid expression, assumed zero C:\Documents and Settings\Petra\Bureaublad\Server\gamemodes\airwar.pwn(101) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 8 Errors. WIE DIT KAN FIXEN BEN IK ECHT HEEEEEEL ERG DANKBAAR, WANT HET LIJKT MIJ EEN HELE LEUKE MINI-MODE. Reageren
thuron Geplaatst: 18 mei 2009 Rapport Geplaatst: 18 mei 2009 loose identation maakt niet uit, dat betekent alleen dat de uitlijning niet goed is. public OnPlayerConnect(playerid) { SetPlayerColor(playerid,COLOR_GREY); // Kleur GameTextForPlayer(playerid,"~g~jongeren ~w~vs ~b~smerissen!",2000,5); // Text return 1; moet zijn public OnPlayerConnect(playerid) { SetPlayerColor(playerid,COLOR_GREY); // Kleur GameTextForPlayer(playerid,"~g~jongeren ~w~vs ~b~smerissen!",2000,5); // Text return 1; } Reageren
Morph1 Geplaatst: 18 mei 2009 Auteur Rapport Geplaatst: 18 mei 2009 (bewerkt) heey ty , dat schelen alweer 4 errors, ik heb er nu nog 4 in dit stuk (met name de rode regels) (99) public SetPlayerTeamFromClass(playerid,classid) (100) { (101) if(classid == 0 || classid == 1 || classid == 2) { (102) gTeam[playerid] = JONGEREN; (103) } else if(classid == 3 || classid == 4 || classid == 5) { (104) gTeam[playerid] = SMERISSEN; (105) } de errors en warnings zijn nu: C:\Documents and Settings\Petra\Bureaublad\Server\gamemodes\airwar.pwn(94) : warning 217: loose indentation C:\Documents and Settings\Petra\Bureaublad\Server\gamemodes\airwar.pwn(95) : warning 217: loose indentation C:\Documents and Settings\Petra\Bureaublad\Server\gamemodes\airwar.pwn(99) : warning 219: local variable "classid" shadows a variable at a preceding level C:\Documents and Settings\Petra\Bureaublad\Server\gamemodes\airwar.pwn(102) : error 028: invalid subscript (not an array or too many subscripts): "gTeam" C:\Documents and Settings\Petra\Bureaublad\Server\gamemodes\airwar.pwn(102) : warning 215: expression has no effect C:\Documents and Settings\Petra\Bureaublad\Server\gamemodes\airwar.pwn(102) : error 001: expected token: ";", but found "]" C:\Documents and Settings\Petra\Bureaublad\Server\gamemodes\airwar.pwn(102) : error 029: invalid expression, assumed zero C:\Documents and Settings\Petra\Bureaublad\Server\gamemodes\airwar.pwn(102) : fatal error 107: too many error messages on one line Bewerkt: 18 mei 2009 door Morph1 Reageren
David22 Geplaatst: 19 mei 2009 Rapport Geplaatst: 19 mei 2009 new classid;new gTeam; #define TEAM_JONGEREN 1 // Team jongeren #define TEAM_SMERISEN 2 // Team smerisen Hier maak je twee variabelen aan (classid en gTeam), maar deze kloppen geen van twee. Classid moet je helemaal weghalen (wordt al gemaakt in callbacks) en van gTeam moet je gTeam[MAX_PLAYERS] maken. (99) public SetPlayerTeamFromClass(playerid,classid)(100) { (101) if(classid == 0 || classid == 1 || classid == 2) { (102) gTeam[playerid] = JONGEREN; (103) } else if(classid == 3 || classid == 4 || classid == 5) { (104) gTeam[playerid] = SMERISSEN; (105) } Eerst define je TEAM_JONGEREN en TEAM_SMERISSEN? Dat gaat nooit werken. Je moet dezeflde namen blijven gebruiken, anders krijg je inderdaad errors. (99) public SetPlayerTeamFromClass(playerid,classid) (100) { (101) if(classid == 0 || classid == 1 || classid == 2) { (102) gTeam[playerid] = TEAM_JONGEREN; (103) } else if(classid == 3 || classid == 4 || classid == 5) { (104) gTeam[playerid] = TEAM_SMERISSEN; (105) } Zo moet het wel . Reageren
Morph1 Geplaatst: 19 mei 2009 Auteur Rapport Geplaatst: 19 mei 2009 oh , ik ben pas zaterdag echt begonnen met scripten dus ik weet er nog niet zoveel vanaf Reageren
Morph1 Geplaatst: 19 mei 2009 Auteur Rapport Geplaatst: 19 mei 2009 , het gaat nu dus weer niet, ik heb wat lope klote maar ik hou de hele tijd 4 errors, kan iemand nog ff helpen #include <a_samp> #include <float> #include <core> new gTeam[MAX_PLAYERS]; new TEAM_SMERISSEN #define TEAM_JONGEREN 1 // Team jongeren #define TEAM_SMERISEN 2 // Team smerisen #define COLOR_GREEN 0x32CD32AA // Kleur jongeren #define COLOR_BLUE 0x0000CDAA // Kleur smerisen #define COLOR_GREY 0xAFAFAFAA // Kleur wanneer je inactive bent //------------------------------------------------------------------------------ ; SetPlayerToTeamColor(playerid); // Speler naar teamkleur zetten forward SetupPlayerForClassSelection(playerid); // Speler klaarmaken voor setup forward SetPlayerTeamFromClass(playerid,classid); // Speler in team zetten forward ExitTheGameMode(); // uit gamemode gaan //------------------------------------------------------------------------------ public OnGameModeInit() { // Don't use these lines if it's a filterscript SetGameModeText("Airwar"); AddPlayerClass(67,1660.312,-2402.307,13.55469,134.7722,28,500,37,250,5,0); // jongeren 1 AddPlayerClass(115,1660.312,-2402.307,13.55469,134.7722,28,500,37,250,5,0);// jongeren 1 AddPlayerClass(170,1660.312,-2402.307,13.55469,134.7722,28,500,37,250,5,0); // jongeren 1 AddPlayerClass(280,1645.818,-2675.571,13.54688,330.6429,22,250,23,250,25,100); // smeris AddPlayerClass(281,1645.818,-2675.571,13.54688,330.6429,22,250,23,250,25,100); // smeris AddPlayerClass(284,1645.818,-2675.571,13.54688,330.6429,22,250,23,250,25,100); // smeris AddStaticVehicle(476,1796.8372,-2476.2964,14.2673,178.3301,89,91); // AddStaticVehicle(476,1783.2672,-2476.2642,14.2623,181.1099,103,102); // AddStaticVehicle(476,1771.3412,-2476.3823,14.2729,178.8508,71,77); // AddStaticVehicle(476,1758.2069,-2476.7354,14.2697,178.8175,7,6); // AddStaticVehicle(476,1746.1855,-2476.2761,14.2965,179.9581,71,77); // AddStaticVehicle(476,1734.3160,-2476.1763,14.2642,178.8368,7,6); // AddStaticVehicle(476,1722.0498,-2476.4106,14.2737,179.8360,71,77); // AddStaticVehicle(476,1709.5515,-2476.3210,14.2809,182.0177,7,6); // AddStaticVehicle(476,1696.7780,-2476.3201,14.2612,180.0188,71,77); // AddStaticVehicle(476,1685.2684,-2476.1899,14.2658,179.4795,89,91); // AddStaticVehicle(476,1672.4994,-2475.9961,14.2651,176.1573,7,6); // AddStaticVehicle(476,1660.0139,-2476.0527,14.2938,180.8458,71,77); // AddStaticVehicle(476,1647.6143,-2476.6177,14.2657,182.1340,89,91); // AddStaticVehicle(476,1636.1099,-2476.5342,14.2624,179.2340,7,6); // AddStaticVehicle(577,1433.3184,-2493.7463,13.4710,270.0286,8,10); // AddStaticVehicle(485,1448.1206,-2570.5955,13.2040,188.0168,1,77); // AddStaticVehicle(476,1543.5247,-2611.1943,14.2495,355.4034,6,7); // AddStaticVehicle(476,1557.3591,-2610.9236,14.2507,0.0384,89,91); // AddStaticVehicle(476,1570.4740,-2611.2544,14.2735,1.3837,103,102); // AddStaticVehicle(476,1582.1486,-2611.1697,14.2573,1.8149,71,77); // AddStaticVehicle(476,1596.1619,-2611.3086,14.2503,359.9931,7,6); // AddStaticVehicle(476,1609.3242,-2611.1287,14.2523,357.7919,89,91); // AddStaticVehicle(476,1622.7618,-2611.5640,14.2722,3.9697,103,102); // AddStaticVehicle(476,1637.1892,-2611.2649,14.2527,357.1283,71,77); // AddStaticVehicle(476,1650.5060,-2611.2571,14.2499,359.6149,7,6); // AddStaticVehicle(476,1662.8473,-2611.1250,14.2710,0.8926,89,91); // AddStaticVehicle(476,1675.7589,-2610.9846,14.2561,0.7057,103,102); // AddStaticVehicle(476,1688.6541,-2611.4038,14.2525,358.5987,71,77); // AddStaticVehicle(476,1702.0942,-2612.0305,14.2632,359.5744,7,6); // AddStaticVehicle(476,1715.8359,-2612.0088,14.2420,356.4739,89,91); // AddStaticVehicle(497,1943.3289,-2645.4976,13.7244,0.0011,0,1); // AddStaticVehicle(497,1956.4980,-2644.9470,13.7237,0.6498,0,1); // AddStaticVehicle(564,1969.6356,-2468.0806,12.7085,185.7075,0,0); // AddStaticVehicle(564,1964.7548,-2468.0852,12.7085,186.1145,0,0); // AddStaticVehicle(564,1959.8259,-2468.7590,12.7085,187.1175,0,0); // AddStaticVehicle(583,2061.5159,-2431.3315,13.0874,131.8745,1,1); // AddStaticVehicle(594,1666.8236,-2419.0300,12.7390,201.2130,0,0); // AddStaticVehicle(607,1496.3966,-2430.9326,13.6093,163.2427,0,0); // AddStaticVehicle(485,1454.7504,-2465.1226,13.2076,182.7222,1,79); // AddStaticVehicle(606,1556.2045,-2641.1638,13.5993,137.5406,0,0); // AddStaticVehicle(606,1649.6750,-2542.9236,17.2856,269.0840,0,0); // AddStaticVehicle(606,1649.6942,-2533.4072,17.2846,270.3615,0,0); // AddStaticVehicle(606,1650.0625,-2553.0283,17.2858,270.5369,0,0); // AddStaticVehicle(425,1957.4086,-2196.6865,14.1190,272.3766,43,0); // AddStaticVehicle(577,1445.9379,-2594.9373,13.4629,270.9230,8,16); // groot vliegtuig AddStaticVehicle(608,1454.7676,-2537.7104,14.0783,358.7568,1,1); // trappetje AddStaticVehicle(608,1458.4314,-2439.8789,14.0876,0.0000,1,1); // trappetje2 return 1; } //------------------------------------------------------------------------------ public OnPlayerConnect(playerid) { SetPlayerColor(playerid,COLOR_GREY); // Kleur GameTextForPlayer(playerid,"~g~jongeren ~w~vs ~b~smerissen!",2000,5); // Text return 1; } //------------------------------------------------------------------------------ public SetupPlayerForClassSelection(playerid) { SetPlayerInterior(playerid,280); SetPlayerPos(playerid,1660.312,-2402.307,13.55469); SetPlayerCameraPos(playerid,1660.312,-2402.307,13.55469); SetPlayerCameraLookAt(playerid,1660.312,-2406.307,13.55469); SetPlayerFacingAngle(playerid,548.8462); } //------------------------------------------------------------------------------ public SetPlayerTeamFromClass(playerid,classid) { if(classid == 0 || classid == 1 || classid == 2) { gTeam[playerid] = TEAM_JONGEREN; } else if(classid == 3 || classid == 4 || classid == 5) { gTeam[playerid] = TEAM_SMERISSEN; } } //------------------------------------------------------------------------------ public SetPlayerToTeamColor(playerid) { if(gTeam[playerid] == TEAM_JONGEREN) { SetPlayerColor(playerid,COLOR_GREEN); // geel } else if(gTeam[playerid] == TEAM_SMERISSEN) { SetPlayerColor(playerid,COLOR_BLUE); // roze/paars } } //------------------------------------------------------------------------------ public OnPlayerRequestClass(playerid, classid) { SetupPlayerForClassSelection(playerid); SetPlayerTeamFromClass(playerid,classid); if(classid == 0 || classid == 1 || classid == 2) { GameTextForPlayer(playerid,"~g~Jongeren",1000,5); } else if(classid == 3 || classid == 4 || classid == 5) { GameTextForPlayer(playerid,"~b~Smerissen",1000,5); } return 1; } //------------------------------------------------------------------------------ public OnPlayerSpawn(playerid) { SetPlayerToTeamColor(playerid); SetPlayerInterior(playerid,0); if(gTeam[playerid] == TEAM_JONGEREN) { GameTextForPlayer(playerid, "vermoord zoveel mogelijk ~b~Smerissen, maak gebruik van de vliegtuigen!" 6000,5); } else if(gTeam[playerid] == TEAM_SMERISSEN) { GameTextForPlayer(playerid, "vermoord zoveel mogelijk ~g~Jongeren, maak gebruik van de vliegtuigen!" 6000,5); } return 1; } //------------------------------------------------------------------------------ public ExitTheGameMode() { GameModeExit(); } //------------------------------------------------------------------------------ public OnPlayerDeath(playerid, killerid, reason) { new deathstr[256]; new whodiedname[MAX_PLAYER_NAME+1]; new whokilledname[MAX_PLAYER_NAME+1]; new deathreasonstr[256]; GetPlayerName(playerid,whodiedname,MAX_PLAYER_NAME); GetWeaponName(reason,deathreasonstr,255); if(killerid == INVALID_PLAYER_ID) { if(strlen(deathreasonstr)) { format(deathstr,256,"%s died (%s)",whodiedname,deathreasonstr); } else { format(deathstr,256,"%s died",whodiedname); } SendClientMessageToAll(OBJECTIVE_COLOR, deathstr); } else { GetPlayerName(killerid,whokilledname,MAX_PLAYER_NAME); if(gTeam[killerid] != gTeam[playerid]) { // Valid kill if(strlen(deathreasonstr)) { format(deathstr,256,"%s was killed by %s (%s)",whodiedname,whokilledname,deathreasonstr); } else { format(deathstr,256,"%s was killed by %s",whodiedname,whokilledname); } SendClientMessageToAll(OBJECTIVE_COLOR, deathstr); SetPlayerScore(killerid,GetPlayerScore(killerid)+1); } else { // Team kill format(deathstr,256,"%s killed team-mate %s (%s)",whokilledname,whodiedname,deathreasonstr); SendClientMessageToAll(OBJECTIVE_COLOR, deathstr); } } return 1; } en de errors en warnings C:\Documents and Settings\Petra\Bureaublad\Server\gamemodes\airwar.pwn(93) : warning 217: loose indentation C:\Documents and Settings\Petra\Bureaublad\Server\gamemodes\airwar.pwn(94) : warning 217: loose indentation C:\Documents and Settings\Petra\Bureaublad\Server\gamemodes\airwar.pwn(136 -- 138) : error 001: expected token: ",", but found "-integer value-" C:\Documents and Settings\Petra\Bureaublad\Server\gamemodes\airwar.pwn(138) : warning 217: loose indentation C:\Documents and Settings\Petra\Bureaublad\Server\gamemodes\airwar.pwn(138) : warning 215: expression has no effect C:\Documents and Settings\Petra\Bureaublad\Server\gamemodes\airwar.pwn(138) : warning 215: expression has no effect C:\Documents and Settings\Petra\Bureaublad\Server\gamemodes\airwar.pwn(138) : error 001: expected token: ";", but found ")" C:\Documents and Settings\Petra\Bureaublad\Server\gamemodes\airwar.pwn(138) : error 029: invalid expression, assumed zero C:\Documents and Settings\Petra\Bureaublad\Server\gamemodes\airwar.pwn(138) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase 4 Errors. Reageren
David22 Geplaatst: 19 mei 2009 Rapport Geplaatst: 19 mei 2009 Geef nooit een define en een variabele dezelfde naam. Zorgt in het grootste gedeelte van de gevallen voor problemen. Reageren
Morph1 Geplaatst: 19 mei 2009 Auteur Rapport Geplaatst: 19 mei 2009 ok dat heb ik nu weer weggehaald maar dan heb ik weer 6 errors, kan je misch plz 1 keer mijn hele script fixen, is wel zo handig. C:\Documents and Settings\Petra\Bureaublad\Server\gamemodes\airwar.pwn(103) : error 017: undefined symbol "TEAM_SMERISSEN" C:\Documents and Settings\Petra\Bureaublad\Server\gamemodes\airwar.pwn(111) : error 017: undefined symbol "TEAM_SMERISSEN" C:\Documents and Settings\Petra\Bureaublad\Server\gamemodes\airwar.pwn(136 -- 138) : error 001: expected token: ",", but found "-integer value-" C:\Documents and Settings\Petra\Bureaublad\Server\gamemodes\airwar.pwn(138) : warning 217: loose indentation C:\Documents and Settings\Petra\Bureaublad\Server\gamemodes\airwar.pwn(138) : warning 215: expression has no effect C:\Documents and Settings\Petra\Bureaublad\Server\gamemodes\airwar.pwn(138) : warning 215: expression has no effect C:\Documents and Settings\Petra\Bureaublad\Server\gamemodes\airwar.pwn(138) : error 001: expected token: ";", but found ")" C:\Documents and Settings\Petra\Bureaublad\Server\gamemodes\airwar.pwn(138) : error 029: invalid expression, assumed zero C:\Documents and Settings\Petra\Bureaublad\Server\gamemodes\airwar.pwn(138) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase 6 Errors. Reageren
thuron Geplaatst: 19 mei 2009 Rapport Geplaatst: 19 mei 2009 #include <a_samp> #include <float> #include <core> new gTeam[MAX_PLAYERS]; new TEAM_SMERISSEN #define TEAM_JONGEREN 1 // Team jongeren #define TEAM_SMERISEN 2 // Team smerisen #define COLOR_GREEN 0x32CD32AA // Kleur jongeren #define COLOR_BLUE 0x0000CDAA // Kleur smerisen #define COLOR_GREY 0xAFAFAFAA // Kleur wanneer je inactive bent #define OBJECTIVE_COLOR 0xAFAFAFAA //------------------------------------------------------------------------------ ; SetPlayerToTeamColor(playerid); // Speler naar teamkleur zetten forward SetupPlayerForClassSelection(playerid); // Speler klaarmaken voor setup forward SetPlayerTeamFromClass(playerid,classid); // Speler in team zetten forward ExitTheGameMode(); // uit gamemode gaan //------------------------------------------------------------------------------ public OnGameModeInit() { // Don't use these lines if it's a filterscript SetGameModeText("Airwar"); AddPlayerClass(67,1660.312,-2402.307,13.55469,134.7722,28,500,37,250,5,0); // jongeren 1 AddPlayerClass(115,1660.312,-2402.307,13.55469,134.7722,28,500,37,250,5,0);// jongeren 1 AddPlayerClass(170,1660.312,-2402.307,13.55469,134.7722,28,500,37,250,5,0); // jongeren 1 AddPlayerClass(280,1645.818,-2675.571,13.54688,330.6429,22,250,23,250,25,100); // smeris AddPlayerClass(281,1645.818,-2675.571,13.54688,330.6429,22,250,23,250,25,100); // smeris AddPlayerClass(284,1645.818,-2675.571,13.54688,330.6429,22,250,23,250,25,100); // smeris AddStaticVehicle(476,1796.8372,-2476.2964,14.2673,178.3301,89,91); // AddStaticVehicle(476,1783.2672,-2476.2642,14.2623,181.1099,103,102); // AddStaticVehicle(476,1771.3412,-2476.3823,14.2729,178.8508,71,77); // AddStaticVehicle(476,1758.2069,-2476.7354,14.2697,178.8175,7,6); // AddStaticVehicle(476,1746.1855,-2476.2761,14.2965,179.9581,71,77); // AddStaticVehicle(476,1734.3160,-2476.1763,14.2642,178.8368,7,6); // AddStaticVehicle(476,1722.0498,-2476.4106,14.2737,179.8360,71,77); // AddStaticVehicle(476,1709.5515,-2476.3210,14.2809,182.0177,7,6); // AddStaticVehicle(476,1696.7780,-2476.3201,14.2612,180.0188,71,77); // AddStaticVehicle(476,1685.2684,-2476.1899,14.2658,179.4795,89,91); // AddStaticVehicle(476,1672.4994,-2475.9961,14.2651,176.1573,7,6); // AddStaticVehicle(476,1660.0139,-2476.0527,14.2938,180.8458,71,77); // AddStaticVehicle(476,1647.6143,-2476.6177,14.2657,182.1340,89,91); // AddStaticVehicle(476,1636.1099,-2476.5342,14.2624,179.2340,7,6); // AddStaticVehicle(577,1433.3184,-2493.7463,13.4710,270.0286,8,10); // AddStaticVehicle(485,1448.1206,-2570.5955,13.2040,188.0168,1,77); // AddStaticVehicle(476,1543.5247,-2611.1943,14.2495,355.4034,6,7); // AddStaticVehicle(476,1557.3591,-2610.9236,14.2507,0.0384,89,91); // AddStaticVehicle(476,1570.4740,-2611.2544,14.2735,1.3837,103,102); // AddStaticVehicle(476,1582.1486,-2611.1697,14.2573,1.8149,71,77); // AddStaticVehicle(476,1596.1619,-2611.3086,14.2503,359.9931,7,6); // AddStaticVehicle(476,1609.3242,-2611.1287,14.2523,357.7919,89,91); // AddStaticVehicle(476,1622.7618,-2611.5640,14.2722,3.9697,103,102); // AddStaticVehicle(476,1637.1892,-2611.2649,14.2527,357.1283,71,77); // AddStaticVehicle(476,1650.5060,-2611.2571,14.2499,359.6149,7,6); // AddStaticVehicle(476,1662.8473,-2611.1250,14.2710,0.8926,89,91); // AddStaticVehicle(476,1675.7589,-2610.9846,14.2561,0.7057,103,102); // AddStaticVehicle(476,1688.6541,-2611.4038,14.2525,358.5987,71,77); // AddStaticVehicle(476,1702.0942,-2612.0305,14.2632,359.5744,7,6); // AddStaticVehicle(476,1715.8359,-2612.0088,14.2420,356.4739,89,91); // AddStaticVehicle(497,1943.3289,-2645.4976,13.7244,0.0011,0,1); // AddStaticVehicle(497,1956.4980,-2644.9470,13.7237,0.6498,0,1); // AddStaticVehicle(564,1969.6356,-2468.0806,12.7085,185.7075,0,0); // AddStaticVehicle(564,1964.7548,-2468.0852,12.7085,186.1145,0,0); // AddStaticVehicle(564,1959.8259,-2468.7590,12.7085,187.1175,0,0); // AddStaticVehicle(583,2061.5159,-2431.3315,13.0874,131.8745,1,1); // AddStaticVehicle(594,1666.8236,-2419.0300,12.7390,201.2130,0,0); // AddStaticVehicle(607,1496.3966,-2430.9326,13.6093,163.2427,0,0); // AddStaticVehicle(485,1454.7504,-2465.1226,13.2076,182.7222,1,79); // AddStaticVehicle(606,1556.2045,-2641.1638,13.5993,137.5406,0,0); // AddStaticVehicle(606,1649.6750,-2542.9236,17.2856,269.0840,0,0); // AddStaticVehicle(606,1649.6942,-2533.4072,17.2846,270.3615,0,0); // AddStaticVehicle(606,1650.0625,-2553.0283,17.2858,270.5369,0,0); // AddStaticVehicle(425,1957.4086,-2196.6865,14.1190,272.3766,43,0); // AddStaticVehicle(577,1445.9379,-2594.9373,13.4629,270.9230,8,16); // groot vliegtuig AddStaticVehicle(608,1454.7676,-2537.7104,14.0783,358.7568,1,1); // trappetje AddStaticVehicle(608,1458.4314,-2439.8789,14.0876,0.0000,1,1); // trappetje2 return 1; } //------------------------------------------------------------------------------ public OnPlayerConnect(playerid) { SetPlayerColor(playerid,COLOR_GREY); // Kleur GameTextForPlayer(playerid,"~g~jongeren ~w~vs ~b~smerissen!",2000,5); // Text return 1; } //------------------------------------------------------------------------------ public SetupPlayerForClassSelection(playerid) { SetPlayerInterior(playerid,280); SetPlayerPos(playerid,1660.312,-2402.307,13.55469); SetPlayerCameraPos(playerid,1660.312,-2402.307,13.55469); SetPlayerCameraLookAt(playerid,1660.312,-2406.307,13.55469); SetPlayerFacingAngle(playerid,548.8462); } //------------------------------------------------------------------------------ public SetPlayerTeamFromClass(playerid,classid) { if(classid == 0 || classid == 1 || classid == 2) { gTeam[playerid] = TEAM_JONGEREN; } else if(classid == 3 || classid == 4 || classid == 5) { gTeam[playerid] = TEAM_SMERISSEN; } } //------------------------------------------------------------------------------ public SetPlayerToTeamColor(playerid) { if(gTeam[playerid] == TEAM_JONGEREN) { SetPlayerColor(playerid,COLOR_GREEN); // geel } else if(gTeam[playerid] == TEAM_SMERISSEN) { SetPlayerColor(playerid,COLOR_BLUE); // roze/paars } } //------------------------------------------------------------------------------ public OnPlayerRequestClass(playerid, classid) { SetupPlayerForClassSelection(playerid); SetPlayerTeamFromClass(playerid,classid); if(classid == 0 || classid == 1 || classid == 2) { GameTextForPlayer(playerid,"~g~Jongeren",1000,5); } else if(classid == 3 || classid == 4 || classid == 5) { GameTextForPlayer(playerid,"~b~Smerissen",1000,5); } return 1; } //------------------------------------------------------------------------------ public OnPlayerSpawn(playerid) { SetPlayerToTeamColor(playerid); SetPlayerInterior(playerid,0); if(gTeam[playerid] == TEAM_JONGEREN) { GameTextForPlayer(playerid,"vermoord zoveel mogelijk ~b~Smerissen, maak gebruik van de vliegtuigen!",6000,5); } else if(gTeam[playerid] == TEAM_SMERISSEN) { GameTextForPlayer(playerid,"vermoord zoveel mogelijk ~g~Jongeren, maak gebruik van de vliegtuigen!",6000,5); } return 1; } //------------------------------------------------------------------------------ public ExitTheGameMode() { GameModeExit(); } //------------------------------------------------------------------------------ public OnPlayerDeath(playerid, killerid, reason) { new deathstr[256]; new whodiedname[MAX_PLAYER_NAME+1]; new whokilledname[MAX_PLAYER_NAME+1]; new deathreasonstr[256]; GetPlayerName(playerid,whodiedname,MAX_PLAYER_NAME); GetWeaponName(reason,deathreasonstr,255); if(killerid == INVALID_PLAYER_ID) { if(strlen(deathreasonstr)) { format(deathstr,256,"%s died (%s)",whodiedname,deathreasonstr); } else { format(deathstr,256,"%s died",whodiedname); } SendClientMessageToAll(OBJECTIVE_COLOR, deathstr); } else { GetPlayerName(killerid,whokilledname,MAX_PLAYER_NAME); if(gTeam[killerid] != gTeam[playerid]) { // Valid kill if(strlen(deathreasonstr)) { format(deathstr,256,"%s was killed by %s (%s)",whodiedname,whokilledname,deathreasonstr); } else { format(deathstr,256,"%s was killed by %s",whodiedname,whokilledname); } SendClientMessageToAll(OBJECTIVE_COLOR, deathstr); SetPlayerScore(killerid,GetPlayerScore(killerid)+1); } else { // Team kill format(deathstr,256,"%s killed team-mate %s (%s)",whokilledname,whodiedname,deathreasonstr); SendClientMessageToAll(OBJECTIVE_COLOR, deathstr); } } return 1; } moet je alleen nog even OBJECTIVE_COLOR naar jou keus definen Reageren
Morph1 Geplaatst: 19 mei 2009 Auteur Rapport Geplaatst: 19 mei 2009 ah thanks gast, hoe krijg je het voor elkaar!!! geen errors en geen warnings. THURON, YOU ARE THE BEST!!! complimenten. ik weet niet of het hier kan, maar anders *slotje* Reageren
thuron Geplaatst: 19 mei 2009 Rapport Geplaatst: 19 mei 2009 xD geen dank man, als je wil kun je me ff pmmen dan stuur ik je mn msn, dan kun je wat makkelijker vragen als je problemen heb Reageren
Recommended Posts
Een reactie plaatsen
Je kan nu een reactie plaatsen en pas achteraf registreren. Als je al lid bent, log eerst in om met je eigen account een reactie te plaatsen.