Beiträge von brot

    #include <a_samp>
    static gTeam[MAX_PLAYERS];
    #define TEAM_SECURITY 0
    new Security;
    // 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 your name here");
    print("--------------------------------------\n");
    return 1;
    }


    public OnFilterScriptExit()
    {
    return 1;
    }


    #else


    main()
    {
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
    }


    #endif


    public OnGameModeInit()
    {
    // Don't use these lines if it's a filterscript
    SetGameModeText("Blank Script");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    new pickup;
    Security = CreatePickup ( 1275, 0, -2192.3591, 288.3956, 35.3203 );



    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("/mycommand", cmdtext, true, 10) == 0)
    {
    // Do something here
    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)
    {
    if (pickupid == Security) // mal gucken obs funzt
    {
    if (gTeam[playerid] == TEAM_SECURITY)
    print("Du bist nun im Dienst...");
    GivePlayerWeapon(playerid, 23);
    GivePlayerWeapon(playerid, 29);
    }
    else
    {
    print("Sorry, aber du bist kein Mitarbeiter der Security...");
    }
    return 1;
    }


    public OnPlayerSelectedMenuRow(playerid, row)
    {
    return 1;
    }


    public OnPlayerExitedMenu(playerid)
    {
    return 1;
    }


    Zitat

    C:\Users\User\Downloads\samp02Xserver.win32\pawno\Untitled.pwn(40) : warning 203: symbol is never used: "pickup"
    C:\Users\User\Downloads\samp02Xserver.win32\pawno\Untitled.pwn(176) : warning 202: number of arguments does not match definition
    C:\Users\User\Downloads\samp02Xserver.win32\pawno\Untitled.pwn(177) : warning 202: number of arguments does not match definition
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    3 Warnings.

    Die Warnings mag ich weg haben :)

    Könntest du da ne Carownership + /givekey cmd und /savespawn (An nem bestimmten Punkt spawnt der Player immer auch nach verlassen des Spiels) und /savecarspawn oder /park (auto spawnt nur nach gmx neu) und vielleicht noch motorschaden, sodass man mit dem auto nicht mehr fahren kann reinmachen ?


    public OnRconCommand(cmd[])
    {
    new cmd[256];
    new cmd2[256];
    new idx;
    new idc;
    cmd = strtok(cmdtext, idx);
    cmd2 = strtok(cmdtext, idc);
    new tmp[256];
    new tmp2[256];
    if(strcmp(cmd, "/sv", true) == 0)
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)){return SendClientMessage(playerid, COLOR_RED, "BENUTZUNG: /spawnvehikel [modelid]");
    }
    new modelid = strval(tmp);
    GetPlayerPos(playerid, x,y,z);
    GetPlayerFacingAngle(playerid, angle);
    CreateVehicle(modelid, 1742.7283,-1858.6941,13.4141, angle, 1,1, -1); // Spawnt die Vehikel bei der Unity Station
    SendClientMessage(playerid, COLOR_RED, "Vehikel erstellt!");
    return 1;
    }
    if(strcmp(cmdtext, "/dcar", true) == 0)
    {
    new dcar;
    dcar = GetPlayerVehicleID(playerid);
    DestroyVehicle(dcar);
    return 1;
    }
    if(strcmp(cmd2, "/giveskin", true, 7 ) == 0) // Geht auch, digga :D
    {
    tmp2 = strtok(cmdtext, idc);
    if(!strlen(tmp2)){return SendClientMessage(playerid, COLOR_RED, "BENUTZUNG: /giveskin [skinid]");
    }
    new skinid = strval(tmp2);
    SetPlayerSkin(playerid, skinid);
    return 1;
    if (strcmp(cmdtext, "/porthafen", true) == 0) {
    SetPlayerPos(playerid,-1573.2271,111.1439,3.5547);//x,y,z sind die coords
    return 1;
    if (strcmp(cmdtext, "/portmafia", true) == 0) {
    SetPlayerPos(playerid,257.1010,-1364.6881,53.1094);//x,y,z sind die coords
    return 1;
    }




    Kann mir jemand das hinbiegen ?


    Erros ->[hide]E:\crystixxv3.pwn(160) : warning 219: local variable "cmd" shadows a variable at a preceding level
    E:\crystixxv3.pwn(164) : error 017: undefined symbol "strtok"
    E:\crystixxv3.pwn(164) : error 033: array must be indexed (variable "cmd")
    E:\crystixxv3.pwn(165) : error 017: undefined symbol "strtok"
    E:\crystixxv3.pwn(165) : error 033: array must be indexed (variable "cmd2")
    E:\crystixxv3.pwn(172) : error 017: undefined symbol "strtok"
    E:\crystixxv3.pwn(172) : error 033: array must be indexed (variable "tmp")
    E:\crystixxv3.pwn(174) : error 017: undefined symbol "playerid"
    E:\crystixxv3.pwn(174) : error 079: inconsistent return types (array & non-array)
    E:\crystixxv3.pwn(177) : error 017: undefined symbol "playerid"
    E:\crystixxv3.pwn(178) : error 017: undefined symbol "playerid"
    E:\crystixxv3.pwn(180) : error 017: undefined symbol "playerid"
    E:\crystixxv3.pwn(181) : error 079: inconsistent return types (array & non-array)
    E:\crystixxv3.pwn(183) : warning 217: loose indentation
    E:\crystixxv3.pwn(183) : error 017: undefined symbol "cmdtext"
    E:\crystixxv3.pwn(186) : error 017: undefined symbol "playerid"
    E:\crystixxv3.pwn(188) : error 079: inconsistent return types (array & non-array)
    E:\crystixxv3.pwn(191) : warning 217: loose indentation
    E:\crystixxv3.pwn(193) : error 017: undefined symbol "strtok"
    E:\crystixxv3.pwn(193) : error 033: array must be indexed (variable "tmp2")
    E:\crystixxv3.pwn(194) : error 017: undefined symbol "playerid"
    E:\crystixxv3.pwn(194) : error 079: inconsistent return types (array & non-array)
    E:\crystixxv3.pwn(197) : error 017: undefined symbol "playerid"
    E:\crystixxv3.pwn(198) : error 079: inconsistent return types (array & non-array)
    E:\crystixxv3.pwn(200) : warning 225: unreachable code
    E:\crystixxv3.pwn(200) : error 017: undefined symbol "cmdtext"
    E:\crystixxv3.pwn(201) : error 017: undefined symbol "playerid"
    E:\crystixxv3.pwn(202) : error 079: inconsistent return types (array & non-array)
    E:\crystixxv3.pwn(204) : warning 225: unreachable code
    E:\crystixxv3.pwn(204) : error 017: undefined symbol "cmdtext"
    E:\crystixxv3.pwn(205) : error 017: undefined symbol "playerid"[/hide]

    Danke jetzt geht nur leider mein alter script um autos zu spawnen nicht mehr :/


    new cmd[256];
    new idx;
    cmd = strtok(cmdtext, idx);
    new tmp[256];


    if(strcmp(cmd, "/scar", true) == 0)
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)){return SendClientMessage(playerid, COLOR_RED, "BENUTZUNG: /scar [modelid]");
    }
    new modelid = strval(tmp);
    GetPlayerPos(playerid, x,y,z);
    GetPlayerFacingAngle(playerid, angle);
    CreateVehicle(modelid, 1742.7283,-1858.6941,13.4141, angle, 1,1, -1);
    SendClientMessage(playerid, COLOR_RED, "Vehikel erstellt!");
    return 1;
    }
    if(strcmp(cmdtext, "/dcar", true) == 0)
    {
    new dcar;
    dcar = GetPlayerVehicleID(playerid);
    DestroyVehicle(dcar);
    return 1;
    }
    return 0;
    }
    new cmd[255], idx;
    cmd = strtok(cmdtext, idx);


    if( strcmp( cmd, "/giveskin", true, 7 ) == 0 ) {
    cmd = strtok(cmdtext, idx);
    if (!strlen(cmd)) return SendClientMessage(playerid, 0xFF0000, "* Syntax: /giveskin <skinid>");
    SetPlayerSkin( playerid, strval(cmd));
    return 1;
    }
    return 0;

    if(strcmp(cmdtext, "/dcar", true) == 0) { new dcar; dcar = GetPlayerVehicleID(playerid); DestroyVehicle(dcar); return 1; } return 0;

    Tollen dank auch, jetzt möchte ich machen das ich jemandem einen Skin geben kann.


    ich hab momentan den hier, ich möchte auch das statt einer festen skinid es variabel ist.. kann das jemand machen ?


    if( strcmp( cmdtext, "/giveskin", true, 7 ) == 0 )
    {
    SetPlayerSkin( playerid, 277);
    return 1;
    }
    return 0;


    ist immer Invalid Function or declaration

    Hallo ich bin Brot.


    Ich habe einen Home Server gemacht und einen Gamemode drauf gemacht (Kein Godfather) und es ein bisschen übersetzt. Nur klappt er leider nicht denn die exe samp-server stürzt sobald ich connecte ab.. kann also den GM nicht online spielen !!!


    Und noch eine Frage wie mache ich n Server mit Hamachi ?

    ich kann dir nur sagen das dort sehr viel falsch eingerückt ist!!! villt solltest du erstmal einrücken dann ist das auch übersichtlicher


    okay, vielleicht kannst du mir hier helfen ?


    Ich bruache ein command womit man sich autos erstellen und deleten kann !! die ids von den wagen kenne ich

    E:\samp022R2server[1].win32\gamemodes\lvdm.pwn(39) : warning 217: loose indentation
    E:\samp022R2server[1].win32\gamemodes\lvdm.pwn(41) : warning 225: unreachable code
    E:\samp022R2server[1].win32\gamemodes\lvdm.pwn(41) : warning 217: loose indentation
    E:\samp022R2server[1].win32\gamemodes\lvdm.pwn(41) : error 029: invalid expression, assumed zero
    E:\samp022R2server[1].win32\gamemodes\lvdm.pwn(41) : error 004: function "OnFilterScriptExit" is not implemented
    E:\samp022R2server[1].win32\gamemodes\lvdm.pwn(46) : warning 225: unreachable code
    E:\samp022R2server[1].win32\gamemodes\lvdm.pwn(47) : error 001: expected token: ";", but found "-identifier-"
    E:\samp022R2server[1].win32\gamemodes\lvdm.pwn(47) : warning 217: loose indentation
    E:\samp022R2server[1].win32\gamemodes\lvdm.pwn(50) : warning 209: function "OnFilterScriptInit" should return a value
    E:\samp022R2server[1].win32\gamemodes\lvdm.pwn(61) : warning 217: loose indentation
    E:\samp022R2server[1].win32\gamemodes\lvdm.pwn(76) : error 035: argument type mismatch (argument 2)
    E:\samp022R2server[1].win32\gamemodes\lvdm.pwn(77) : warning 217: loose indentation
    E:\samp022R2server[1].win32\gamemodes\lvdm.pwn(86) : error 001: expected token: ",", but found "-string-"
    E:\samp022R2server[1].win32\gamemodes\lvdm.pwn(86) : warning 215: expression has no effect



    SendPlayerMessageToPlayer("blabla"); <- der meint da Argument Type Mismatch


    Und noch ne Frage.. ich möchte ein Command haben.. /Createcar und da gibts ja bestimmte ids.. wie ist der befehl ? zum beispiel ein maverick /createcar 487, wie muss da der befehl sein ?


    und das gleiche auch bei /delcar 487

    Hiho, ich hab mich mal an einem Script versucht.. jedoch habe ich viele Fehler , kann sie mir jemand zeigen, ich weiß nicht was ich falsch gemacht habe.


    #include <a_samp>
    // 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 your name here");
    print("--------------------------------------\n");
    return 1;
    }
    public OnFilterScriptExit()
    {
    return 1;
    }
    #else
    main()
    {
    print("\n----------------------------------");
    print(" GTA-DM by cRy");
    print("----------------------------------\n");
    }
    #endif
    public OnFilterScriptInit()//Hier kommt rein, was passieren soll, wenn der Filterscript geladen wird (Dazu musst du ihn als FS definieren).
    {
    print("\n--------------------------------------");
    print(" Own FIlterscript");
    print("--------------------------------------\n");
    return 1;
    public OnFilterScriptExit()
    {
    return 1;
    }
    main()
    print("\n----------------------------------");
    print(" SA RL/DM");
    print("----------------------------------\n");
    }
    public OnGameModeInit()
    {
    SetGameModeText("SA RL/DM");
    AddPlayerClass( 168, -773.369628, 2086.594970, 60.382812, 216.212066, 0, 0, 0, 0, 0, 0);
    return 1;
    }
    public OnGameModeExit()
    {
    print("GameMode exited!");
    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)
    {
    GivePlayerWeapon(playerid, 353, 500);
    GivePlayerWeapon(playerid, 356, 500);
    SendPlayerMessageToPlayer(playerid, "Welcome ;) HF & GL");
    return 1;
    }
    public OnPlayerConnect(playerid)//Das passiert wenn jemand den Server betritt
    {
    GivePlayerMoney(playerid, 1000);//1000 ist das Startgeld
    new string[256];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(string/*Willkommen*/, sizeof(string)"%s joined the server"/*Willkommen*/, name/*Du bist dem Server gejoint*/);
    SendClientMessageToAll(0x00FF00FF, string);
    return 1;
    }
    public OnPlayerDisconnect(playerid, reason)
    {
    new string[256];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    switch(reason) {
    case 0: format(string, sizeof(string), "%s hat den Server verlassen: Timeout", name);
    case 1: format(string, sizeof(string), "%s hat den Server verlassen: Leaving", name);
    case 2: format(string, sizeof(string), "%s hat den Server verlassen: Kicked/banned", name);
    }
    SendClientMessageToAll(0x00FF00FF, string);//Wir senden die Message
    return 1;
    }


    public OnPlayerSpawn(playerid)
    {
    SendPlayerMessageToPlayer("Du bist gestorben")
    return 1;
    }
    public OnPlayerCommandText(playerid, cmdtext[])
    {
    if (strcmp("/weapons", /weapons, true, 10) == 0)
    {
    GivePlayerWeapon(535, 500)
    return 1;
    }
    return 0;
    }


    DANKE !