[Kleines Problem] 2 Fehler bei einem Carspawn system

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Hallo :) würde gerne wissen woran dies liegt :) C:\Users\ar\Desktop\Scipting\Test.pwn(141) : warning 235: public function lacks forward declaration (symbol "OnPlayerPrivmsg")C:\Users\ar\Desktop\Scipting\Test.pwn(173) : warning 235: public function lacks forward declaration (symbol "OnPlayerInfoChange")Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


    2 Warnings.

  • Die beiden Funktionen sind public Funktionen.
    Um sie zu verwenden, musst du vor ihrer ersten Verwendung sie mit "forward" quasi anmelden.


    Code
    forward x(Float:Y,Float:Z);
    public x(Float:Y,Float:Z)
    {
         //Irgendwas
    }


    Mach das mit deinen entsprechenden Funktionen, dann geht es.
    Das Teil da oben nennt man übrigens Prototyp ;)

  • Kriege es einfach nicht hin 1. 2 errors und 2. will es so machen das es nur für admins geht :) kann mir jemand es villeicht vorscripten :) per teamviewer oder villeicht einfach schicken :thumbup:


    #include <a_samp>new Menu:CarMenu;new Menu:CarMenu2;new Menu:CarMenu3;#define COLOR_GREY 0xAFAFAFAA#define COLOR_GREEN 0x33AA33AA#define COLOR_RED 0xCC0000AA#define COLOR_YELLOW 0xFFFF00AA#define COLOR_WHITE 0xFFFFFFAA
    #pragma tabsize 0// This is a comment// uncomment the line below if you want to write a filterscript
    #define FILTERSCRIPT#if defined FILTERSCRIPT
    public OnFilterScriptInit()
    { print("\n--------------------------------------"); print(" Blank Filterscript by Arthur"); print("--------------------------------------\n");
    CarMenu = CreateMenu("CarMenu", 1, 200.0, 100.0, 150.0, 150.0);
    AddMenuItem(CarMenu, 0, "Infernus"); AddMenuItem(CarMenu, 0, "Sultan"); AddMenuItem(CarMenu, 0, "Blade"); AddMenuItem(CarMenu, 0, "Cheetah"); AddMenuItem(CarMenu, 0, "Elegy"); AddMenuItem(CarMenu, 0, "Comet"); AddMenuItem(CarMenu, 0, "Bikes & stuff"); AddMenuItem(CarMenu, 0, "Nrg-500"); AddMenuItem(CarMenu, 0, "quad-bike"); AddMenuItem(CarMenu, 0, "pcj-600"); AddMenuItem(CarMenu, 0, "pizza-bike"); AddMenuItem(CarMenu, 0, "Next");
    CarMenu2 = CreateMenu("CarMenu", 1, 200.0, 100.0, 150.0, 150.0); AddMenuItem(CarMenu2, 0, "Go Kart"); AddMenuItem(CarMenu2, 0, "Dirt Bike"); AddMenuItem(CarMenu2, 0, "Police bike"); AddMenuItem(CarMenu2, 0, "freeway"); AddMenuItem(CarMenu2, 0, "Bmx"); AddMenuItem(CarMenu2, 0, "bike"); AddMenuItem(CarMenu2, 0, "MtBike"); AddMenuItem(CarMenu2, 0, "Planes & Jets and Other"); AddMenuItem(CarMenu2, 0, "Shamal"); AddMenuItem(CarMenu2, 0, "Hydra"); AddMenuItem(CarMenu2, 0, "Hunter"); AddMenuItem(CarMenu2, 0, "More");CarMenu3 = CreateMenu("CarMenu", 1, 200.0, 100.0, 150.0, 150.0); AddMenuItem(CarMenu3, 0, "Vortex"); AddMenuItem(CarMenu3, 0, "Monster Truck"); AddMenuItem(CarMenu3, 0, "Monster Truck2"); AddMenuItem(CarMenu3, 0, "back"); return 1;}
    public OnFilterScriptExit(){



    return 1;}
    #else
    main(){ print("\n----------------------------------"); print(" Blank Gamemode by Arthur"); print("----------------------------------\n");}
    #endif
    public OnGameModeInit(){


    return 1;}
    public OnGameModeExit(){ return 1;}
    public OnPlayerRequestClass(playerid, classid){ SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746); SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746); SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746); return 1;}
    public OnPlayerRequestSpawn(playerid){ return 1;}
    public OnPlayerConnect(playerid){ return 1;}
    public OnPlayerDisconnect(playerid, reason){ return 1;}
    public OnPlayerSpawn(playerid){
    return 1;}
    public OnPlayerDeath(playerid, killerid, reason){ return 1;}
    public OnVehicleSpawn(vehicleid){ return 1;}
    public OnVehicleDeath(vehicleid, killerid){ return 1;}
    public OnPlayerText(playerid, text[]){ return 1;}
    public OnPlayerPrivmsg(playerid, recieverid, text[]){ return 1;}
    public OnPlayerCommandText(playerid, cmdtext[])
    {if (strcmp(cmdtext, "/v",true)==0) { if(!IsPlayerInAnyVehicle(playerid)) { ShowMenuForPlayer(CarMenu,playerid); } else { SendClientMessage(playerid,0xFFFFFFFF,"You are already in a vehicle"); } return 1;


    } if (strcmp(cmdtext, "/skdhsjeyw6te6nsdyushydgeydtbe6",true)==0) { SendClientMessage(playerid,COLOR_YELLOW,"**********Car Filterscript************"); SendClientMessage(playerid,COLOR_YELLOW,"Filterscript made by Arthur");return 1;}


    return 0;}
    public OnPlayerInfoChange(playerid){ return 1;}
    public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger){ return 1;}
    public OnPlayerExitVehicle(playerid, vehicleid){ return 1;}
    public OnPlayerStateChange(playerid, newstate, oldstate){ 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 OnObjectMoved(objectid){ return 1;}
    public OnPlayerObjectMoved(playerid, objectid){ return 1;}
    public OnPlayerPickUpPickup(playerid, pickupid){ return 1;}
    public OnPlayerSelectedMenuRow(playerid, row){ new Menu:CurrentMenu = GetPlayerMenu(playerid); if(CurrentMenu == CarMenu) { switch(row)
    {


    case 0: //infernus { new Float:x, Float:y, Float:z, Float:a; GetPlayerFacingAngle(playerid,a); GetPlayerPos(playerid, x, y, z); new car; car=CreateVehicle(411,x,y,z+4,a,-1,-1,30000); PutPlayerInVehicle(playerid,car,0); SendClientMessage(playerid, 0xFFFFFFFF, "You Have Selected Infernus");
    } case 1: //armour { new Float:x, Float:y, Float:z, Float:a; GetPlayerFacingAngle(playerid,a); GetPlayerPos(playerid, x, y, z); new car; car=CreateVehicle(560,x,y,z+4,a,-1,-1,30000); PutPlayerInVehicle(playerid,car,0); SendClientMessage(playerid, 0xFFFFFFFF, "You Have Selected Sultan");
    } case 2: //heal+armour { new Float:x, Float:y, Float:z, Float:a; GetPlayerFacingAngle(playerid,a); GetPlayerPos(playerid, x, y, z); new car; car=CreateVehicle(536,x,y,z+4,a,-1,-1,30000); PutPlayerInVehicle(playerid,car,0); SendClientMessage(playerid, 0xFFFFFFFF, "You Have Selected Blade");
    } case 3: //healx2 { new Float:x, Float:y, Float:z, Float:a; GetPlayerFacingAngle(playerid,a); GetPlayerPos(playerid, x, y, z); new car; car=CreateVehicle(415,x,y,z+4,a,-1,-1,30000); PutPlayerInVehicle(playerid,car,0); SendClientMessage(playerid, 0xFFFFFFFF, "You Have Selected Cheetah");
    } case 4: //armourx2 { new Float:x, Float:y, Float:z, Float:a; GetPlayerFacingAngle(playerid,a); GetPlayerPos(playerid, x, y, z); new car; car=CreateVehicle(562,x,y,z+4,a,-1,-1,30000); PutPlayerInVehicle(playerid,car,0); SendClientMessage(playerid, 0xFFFFFFFF, "You Have Selected Elegy");
    } case 5: //M4 { new Float:x, Float:y, Float:z, Float:a; GetPlayerFacingAngle(playerid,a); GetPlayerPos(playerid, x, y, z); new car; car=CreateVehicle(480,x,y,z+4,a,-1,-1,30000); PutPlayerInVehicle(playerid,car,0); SendClientMessage(playerid, 0xFFFFFFFF, "You Have Selected Comet");
    } case 6: //bikes { SendClientMessage(playerid,0xFFFFFFFF,"Select a Vehicle from the list"); ShowMenuForPlayer(CarMenu,playerid);
    } case 7: //M4 { new Float:x, Float:y, Float:z, Float:a; GetPlayerFacingAngle(playerid,a); GetPlayerPos(playerid, x, y, z); new car; car=CreateVehicle(522,x,y,z+4,a,-1,-1,30000); PutPlayerInVehicle(playerid,car,0); SendClientMessage(playerid, 0xFFFFFFFF, "You Have Selected Nrg-500"); }
    case 8: //M4 { new Float:x, Float:y, Float:z, Float:a; GetPlayerFacingAngle(playerid,a); GetPlayerPos(playerid, x, y, z); new car; car=CreateVehicle(471,x,y,z+4,a,-1,-1,30000); PutPlayerInVehicle(playerid,car,0); SendClientMessage(playerid, 0xFFFFFFFF, "You Have Selected Quad_bike");



    }
    case 9: //next { new Float:x, Float:y, Float:z, Float:a; GetPlayerFacingAngle(playerid,a); GetPlayerPos(playerid, x, y, z); new car; car=CreateVehicle(461,x,y,z+4,a,-1,-1,30000); PutPlayerInVehicle(playerid,car,0); SendClientMessage(playerid, 0xFFFFFFFF, "You Have Selected pcj-600");



    }
    case 10: //pcj-600 { new Float:x, Float:y, Float:z, Float:a; GetPlayerFacingAngle(playerid,a); GetPlayerPos(playerid, x, y, z); new car; car=CreateVehicle(461,x,y,z+4,a,-1,-1,30000); PutPlayerInVehicle(playerid,car,0); SendClientMessage(playerid, 0xFFFFFFFF, "You Have Selected pizza bike");


    }


    case 11: //other vehicles {
    ShowMenuForPlayer(CarMenu2,playerid); }
    } }
    if(CurrentMenu == CarMenu2) { switch(row)
    {


    case 0: //go kart { new Float:x, Float:y, Float:z, Float:a; GetPlayerFacingAngle(playerid,a); GetPlayerPos(playerid, x, y, z); new car; car=CreateVehicle(571,x,y,z+4,a,-1,-1,30000); PutPlayerInVehicle(playerid,car,0); SendClientMessage(playerid, 0xFFFFFFFF, "You Have Selected go kart");
    }case 1: //dirt bike { new Float:x, Float:y, Float:z, Float:a; GetPlayerFacingAngle(playerid,a); GetPlayerPos(playerid, x, y, z); new car; car=CreateVehicle(468,x,y,z+4,a,-1,-1,30000); PutPlayerInVehicle(playerid,car,0); SendClientMessage(playerid, 0xFFFFFFFF, "You Have Selected a Dirt Bike");
    }
    case 2: //police bike { new Float:x, Float:y, Float:z, Float:a; GetPlayerFacingAngle(playerid,a); GetPlayerPos(playerid, x, y, z); new car; car=CreateVehicle(523,x,y,z+4,a,-1,-1,30000); PutPlayerInVehicle(playerid,car,0); SendClientMessage(playerid, 0xFFFFFFFF, "You Have Selected a Police Bike");
    }case 3: { new Float:x, Float:y, Float:z, Float:a; GetPlayerFacingAngle(playerid,a); GetPlayerPos(playerid, x, y, z); new car; car=CreateVehicle(463,x,y,z+4,a,-1,-1,30000); PutPlayerInVehicle(playerid,car,0); SendClientMessage(playerid, 0xFFFFFFFF, "You Have Selected a freeway");
    }case 4: { new Float:x, Float:y, Float:z, Float:a; GetPlayerFacingAngle(playerid,a); GetPlayerPos(playerid, x, y, z); new car; car=CreateVehicle(481,x,y,z+4,a,-1,-1,30000); PutPlayerInVehicle(playerid,car,0); SendClientMessage(playerid, 0xFFFFFFFF, "You Have Selected a BMX bycicle");
    }case 5: { new Float:x, Float:y, Float:z, Float:a; GetPlayerFacingAngle(playerid,a); GetPlayerPos(playerid, x, y, z); new car; car=CreateVehicle(509,x,y,z+4,a,-1,-1,30000); PutPlayerInVehicle(playerid,car,0); SendClientMessage(playerid, 0xFFFFFFFF, "You Have Selected a normal bycicle");
    }case 6: { new Float:x, Float:y, Float:z, Float:a; GetPlayerFacingAngle(playerid,a); GetPlayerPos(playerid, x, y, z); new car; car=CreateVehicle(510,x,y,z+4,a,-1,-1,30000); PutPlayerInVehicle(playerid,car,0); SendClientMessage(playerid, 0xFFFFFFFF, "You Have Selected a Mountain Bike");
    }case 7: // Planes Jets etc {SendClientMessage(playerid,0xFFFFFFFF,"Please Select a Vehicle from the menu");
    }case 8: { new Float:x, Float:y, Float:z, Float:a; GetPlayerFacingAngle(playerid,a); GetPlayerPos(playerid, x, y, z); new car; car=CreateVehicle(519,x,y,z+4,a,-1,-1,30000); PutPlayerInVehicle(playerid,car,0); SendClientMessage(playerid, 0xFFFFFFFF, "You Have Selected a Shamal");
    }case 9: { new Float:x, Float:y, Float:z, Float:a; GetPlayerFacingAngle(playerid,a); GetPlayerPos(playerid, x, y, z); new car; car=CreateVehicle(520,x,y,z+4,a,-1,-1,30000); PutPlayerInVehicle(playerid,car,0); SendClientMessage(playerid, 0xFFFFFFFF, "You Have Selected a Hydra");
    }case 10: { new Float:x, Float:y, Float:z, Float:a; GetPlayerFacingAngle(playerid,a); GetPlayerPos(playerid, x, y, z); new car; car=CreateVehicle(425,x,y,z+4,a,-1,-1,30000); PutPlayerInVehicle(playerid,car,0); SendClientMessage(playerid, 0xFFFFFFFF, "You Have Selected a Hunter");
    }case 11: {ShowMenuForPlayer(CarMenu3,playerid); } } }if(CurrentMenu == CarMenu3) { switch(row)
    {


    case 0: { new Float:x, Float:y, Float:z, Float:a; GetPlayerFacingAngle(playerid,a); GetPlayerPos(playerid, x, y, z); new car; car=CreateVehicle(539,x,y,z+4,a,-1,-1,30000); PutPlayerInVehicle(playerid,car,0); SendClientMessage(playerid, 0xFFFFFFFF, "You Have Selected Vortex");
    }case 1: { new Float:x, Float:y, Float:z, Float:a; GetPlayerFacingAngle(playerid,a); GetPlayerPos(playerid, x, y, z); new car; car=CreateVehicle(444,x,y,z+4,a,-1,-1,30000); PutPlayerInVehicle(playerid,car,0); SendClientMessage(playerid, 0xFFFFFFFF, "You Have Selected Monster Truck");
    }case 2: { new Float:x, Float:y, Float:z, Float:a; GetPlayerFacingAngle(playerid,a); GetPlayerPos(playerid, x, y, z); new car; car=CreateVehicle(556,x,y,z+4,a,-1,-1,30000); PutPlayerInVehicle(playerid,car,0); SendClientMessage(playerid, 0xFFFFFFFF, "You Have Selected Monster Truck No.2");
    }case 3: { ShowMenuForPlayer(CarMenu2,playerid); } } } return 1; }
    public OnPlayerExitedMenu(playerid){ return 1;}