Brauche Hilfe beim Gamemode

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
  • Hi Leute...
    Da ich und ein Kumpel von mir einen Server machen,
    wollen wir natürlich auch einen eigenen Gamemode etc.
    Nun hab ich mal in so ein Tutorial reingeschaut und es mal Probiert.
    Hier der Code:

    main()
    {
    print("\n----------------------------------");
    print(" Gamemod by Joshi");
    print("----------------------------------\n");
    }




    public OnGameModeInit()
    {
    SetGameModeText("Deathmatch");
    UsePlayerPedAnims();
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    return 1;
    }


    public OnGameModeExit()
    {
    return 1;
    }


    public OnPlayerRequestClass(playerid, classid)
    {
    SetPlayerPos(playerid, 1449.8280,-2287.5422,13.5469);
    SetPlayerCameraPos(playerid, 1446.0238,-2287.4514,13.5469);
    SetPlayerCameraLookAt(playerid, 1449.8280,-2287.5422,13.5469);
    SetPlayerFacingAngle(playerid, 90.0);
    return 1;
    }


    public OnPlayerRequestSpawn(playerid)
    {
    return 1;
    }


    public OnPlayerConnect(playerid)
    {
    SendClientMessage(playerid,0xFF66FFAA,"Willkommen auf dem [HotS]Clanserver");


    new string[256], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "%s hat den Server betreten", name);
    SendClientMessageToAll(rot, string);
    return 1;
    }


    public OnPlayerDisconnect(playerid, reason)
    {
    return 1;
    }


    public OnPlayerSpawn(playerid)
    {
    return 1;
    }


    public OnPlayerDeath(playerid, killerid, reason)
    {
    if(killerid==INVALID_PLAYER_ID) {
    SendDeathMessage(INVALID_PLAYER_ID,playerid,reason); }
    else {
    SendDeathMessage(killerid,playerid,reason);
    SetPlayerScore(killerid,GetPlayerScore(killerid)+1); }
    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;
    }
    return 0;
    }
    Da ich ein totaler Anfängerim Thema Gta Scripten bin weiss ich jetzt nicht was der Fehler ist...
    Bitte um hilfe,
    Achja hier die Errors


  • #include <a_samp>
    main()
    {
    print("\n----------------------------------");
    print(" Gamemod by Joshi");
    print("----------------------------------\n");
    }




    public OnGameModeInit()
    {
    SetGameModeText("Deathmatch");
    UsePlayerPedAnims();
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    return 1;
    }


    public OnGameModeExit()
    {
    return 1;
    }


    public OnPlayerRequestClass(playerid, classid)
    {
    SetPlayerPos(playerid, 1449.8280,-2287.5422,13.5469);
    SetPlayerCameraPos(playerid, 1446.0238,-2287.4514,13.5469);
    SetPlayerCameraLookAt(playerid, 1449.8280,-2287.5422,13.5469);
    SetPlayerFacingAngle(playerid, 90.0);
    return 1;
    }


    public OnPlayerRequestSpawn(playerid)
    {
    return 1;
    }


    public OnPlayerConnect(playerid)
    {
    SendClientMessage(playerid,0xFF66FFAA,"Willkommen auf dem [HotS]Clanserver");


    new string[256], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "%s hat den Server betreten", name);
    SendClientMessageToAll(rot, string);
    return 1;
    }


    public OnPlayerDisconnect(playerid, reason)
    {
    return 1;
    }


    public OnPlayerSpawn(playerid)
    {
    return 1;
    }


    public OnPlayerDeath(playerid, killerid, reason)
    {
    if(killerid==INVALID_PLAYER_ID) {
    SendDeathMessage(INVALID_PLAYER_ID,playerid,reason); }
    else {
    SendDeathMessage(killerid,playerid,reason);
    SetPlayerScore(killerid,GetPlayerScore(killerid)+1); }
    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;
    }
    return 0;
    }


    hier müsste funktionieren

  • Danke allerdings kommt ein Warning und deshalb Wird es nicht Compilet

    Zitat

    C:\Users\Joshua\Desktop\HotS clanserver\gamemodes\hots.pwn(85) : warning 235: public function lacks forward declaration (symbol "OnPlayerPrivmsg")
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    1 Warning.

  • #include <a_samp>
    main()
    {
    print("\n----------------------------------");
    print(" Gamemod by Joshi");
    print("----------------------------------\n");
    }




    public OnGameModeInit()
    {
    SetGameModeText("Deathmatch");
    UsePlayerPedAnims();
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    return 1;
    }


    public OnGameModeExit()
    {
    return 1;
    }


    public OnPlayerRequestClass(playerid, classid)
    {
    SetPlayerPos(playerid, 1449.8280,-2287.5422,13.5469);
    SetPlayerCameraPos(playerid, 1446.0238,-2287.4514,13.5469);
    SetPlayerCameraLookAt(playerid, 1449.8280,-2287.5422,13.5469);
    SetPlayerFacingAngle(playerid, 90.0);
    return 1;
    }


    public OnPlayerRequestSpawn(playerid)
    {
    return 1;
    }


    public OnPlayerConnect(playerid)
    {
    SendClientMessage(playerid,0xFF66FFAA,"Willkommen auf dem [HotS]Clanserver");


    new string[256], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "%s hat den Server betreten", name);
    SendClientMessageToAll(rot, string);
    return 1;
    }


    public OnPlayerDisconnect(playerid, reason)
    {
    return 1;
    }


    public OnPlayerSpawn(playerid)
    {
    return 1;
    }


    public OnPlayerDeath(playerid, killerid, reason)
    {
    if(killerid==INVALID_PLAYER_ID) {
    SendDeathMessage(INVALID_PLAYER_ID,playerid,reason); }
    else {
    SendDeathMessage(killerid,playerid,reason);
    SetPlayerScore(killerid,GetPlayerScore(killerid)+1); }
    return 1;
    }


    public OnVehicleSpawn(vehicleid)
    {
    return 1;
    }


    public OnVehicleDeath(vehicleid, killerid)
    {
    return 1;
    }


    public OnPlayerText(playerid, text[])
    {
    return 1;
    }


    da des müsste etz gehen