HILFE mit Deathmatchzone

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,
    ich habe eine Deathmatchzone erstellt, mit pickups wie waffen,armor usw..
    Wenn ich dann im Spiel /dm eingebe werde ich an eine ganz andere Stelle teleportiert wie ich angegeben habe. Ich will an die Stelle teleportiert werden, da wo das erste Pickup ist. Also im Script zum ersten Pickup (siehe script)
    Hier das Script:



    #include <a_samp>
    #include <dini>


    #pragma tabsize 0
    #define FILTERSCRIPT


    #if defined FILTERSCRIPT


    forward OtherTimer();


    new Float:TelePos[MAX_PLAYERS][6];


    public OnFilterScriptInit()
    {
    print("\n--------------------------------------");
    print(" Filterscript >>Deathmatch<< by Markus");
    print("--------------------------------------\n");
    if(dini_Exists("admplace.ini"))
    {
    print(" File Founded...Loaded.");
    }
    else
    {
    dini_Create("admplace.ini");
    print(" > File Created admplace.ini");
    }



    CreatePickup(351,2,-1434.4117,-15.7969,357.4673); //
    CreatePickup(351,2,-1118.9890,-1444.8811,15.7969); //
    CreatePickup(351,2,-1119.0780,-1456.0524,15.7969); //
    CreatePickup(351,2,-1119.1696,-1467.5369,15.7766); //
    CreatePickup(351,2,-1138.3778,-1467.3284,15.7694); //
    CreatePickup(372,2,-1138.8108,-1456.6642,15.7969); //
    CreatePickup(372,2,-1138.6094,-1444.5778,15.7969); //
    CreatePickup(372,2,-1138.4360,-1433.9639,15.7969); //
    CreatePickup(372,2,-1129.8156,-1483.1918,22.7690); //
    CreatePickup(372,2,-1128.3123,-1483.2275,22.7690); //
    CreatePickup(356,2,-1127.8723,-1469.4141,15.7424); //
    CreatePickup(356,2,-1130.1859,-1469.1998,15.7498); //
    CreatePickup(356,2,-1129.7570,-1494.7749,22.7690); //
    CreatePickup(356,2,-1127.8461,-1495.5160,22.7690); //
    CreatePickup(1240,2,-1128.3176,-1508.9883,15.7777); //
    CreatePickup(1240,2,-1129.9427,-1509.2725,15.7766); //
    CreatePickup(1242,2,-1129.1097,-1517.4158,15.7969); //
    CreatePickup(1242,2,-1143.5594,-1513.2959,15.7969); //
    CreatePickup(1242,2,-1151.3318,-1502.9406,15.7969); //


    AddPlayerClass(0,1107.2589,-1501.5270,15.7969,31.3311,0,0,0,0,0,0); //




    return 1;
    }


    public OnFilterScriptExit()
    {
    return 1;
    }


    #else


    main()
    {
    print("\n----------------------------------");
    print(" Filterscript >>Deathmatch<< by Markus");
    print("----------------------------------\n");
    }


    #endif


    public OnPlayerCommandText(playerid, cmdtext[])
    {
    if (strcmp("/dm", cmdtext, true, 10) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if (GetPlayerState(playerid) == 2)
    {
    new tmpcar = GetPlayerVehicleID(playerid);
    SetVehiclePos(tmpcar, 1118.8177,1434.4117,15.7969,357.4673);
    TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
    }
    else
    {
    SetPlayerPos(playerid, 1118.8177,1434.4117,15.7969,357.4673);
    }
    SendClientMessage(playerid, 0xB8860BAA, "***Welcome to the DM!***");
    SetPlayerInterior(playerid,0);
    }
    }


    if(strcmp("/dm", cmdtext, true, 9) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if (GetPlayerState(playerid) == 2)
    {
    new tmpcar = GetPlayerVehicleID(playerid);
    SetVehiclePos(tmpcar, 887.0850,61.1224,248.4600);
    TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
    }
    else
    {
    SetPlayerPos(playerid, 887.0850,61.1224,248.4600);
    }
    SendClientMessage(playerid, 0xB8860BAA, "***Welcome back to Racing!***");
    SetPlayerInterior(playerid,0);
    }
    }
    return 1;
    }


    public OtherTimer()
    {
    for(new i = 0; i < GetMaxPlayers(); i++)
    {
    if(IsPlayerConnected(i))
    {
    if(GetPlayerState(i) == 2)
    {
    GetPlayerPos(i, TelePos[i][3], TelePos[i][4], TelePos[i][5]);
    if(TelePos[i][5] > 550.0)
    {
    TelePos[i][0] = 0.0;
    TelePos[i][1] = 0.0;
    }
    else if(TelePos[i][5] < 550.0 && TelePos[i][3] != 0.0)
    {
    TelePos[i][0] = TelePos[i][3];
    TelePos[i][1] = TelePos[i][4];
    }
    else
    {
    }
    }
    }
    }
    return 1;
    }


    MfG Maggi ;)

  • Hi,
    jetzt habe ich folgende Errors:


    C:\Dokumente und Einstellungen\Markus Schneider\Desktop\dm_M.pwn(85) : warning 202: number of arguments does not match definition
    C:\Dokumente und Einstellungen\Markus Schneider\Desktop\dm_M.pwn(90) : warning 202: number of arguments does not match definition
    C:\Dokumente und Einstellungen\Markus Schneider\Desktop\dm_M.pwn(94) : warning 215: expression has no effect
    C:\Dokumente und Einstellungen\Markus Schneider\Desktop\dm_M.pwn(110) : warning 215: expression has no effect
    C:\Dokumente und Einstellungen\Markus Schneider\Desktop\dm_M.pwn(116) : error 029: invalid expression, assumed zero
    C:\Dokumente und Einstellungen\Markus Schneider\Desktop\dm_M.pwn(116) : error 004: function "OtherTimer" is not implemented
    C:\Dokumente und Einstellungen\Markus Schneider\Desktop\dm_M.pwn(143) : error 030: compound statement not closed at the end of file (started at line 76)
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    3 Errors.


    MfG

  • un funzt fast alles! KEINE Errors :).
    Aber jetzt werde ich an eine ganz falsche Stelle teleporttiert. Ich will an diese STelle:
    Das ist im Script das erste Pickup. Da will ich hinteleportiert werden.
    351,2,-1434.4117,-15.7969,357.4673


    MfG Maggi ;)

  • MMH,
    ich werde einfach an die falsche Stelle teleporiert.
    Hier der Script:


    #include <a_samp>
    #include <dini>


    #pragma tabsize 0
    #define FILTERSCRIPT


    #if defined FILTERSCRIPT


    forward OtherTimer();


    new Float:TelePos[MAX_PLAYERS][6];
    new dm[MAX_PLAYERS];


    public OnFilterScriptInit()
    {
    print("\n--------------------------------------");
    print(" Filterscript >>Deathmatch<< by Markus");
    print("--------------------------------------\n");
    if(dini_Exists("admplace.ini"))
    {
    print(" File Founded...Loaded.");
    }
    else
    {
    dini_Create("admplace.ini");
    print(" > File Created admplace.ini");
    }



    CreatePickup(351,2,-1434.4117,-15.7969,357.4673); //
    CreatePickup(351,2,-1118.9890,-1444.8811,15.7969); //
    CreatePickup(351,2,-1119.0780,-1456.0524,15.7969); //
    CreatePickup(351,2,-1119.1696,-1467.5369,15.7766); //
    CreatePickup(351,2,-1138.3778,-1467.3284,15.7694); //
    CreatePickup(372,2,-1138.8108,-1456.6642,15.7969); //
    CreatePickup(372,2,-1138.6094,-1444.5778,15.7969); //
    CreatePickup(372,2,-1138.4360,-1433.9639,15.7969); //
    CreatePickup(372,2,-1129.8156,-1483.1918,22.7690); //
    CreatePickup(372,2,-1128.3123,-1483.2275,22.7690); //
    CreatePickup(356,2,-1127.8723,-1469.4141,15.7424); //
    CreatePickup(356,2,-1130.1859,-1469.1998,15.7498); //
    CreatePickup(356,2,-1129.7570,-1494.7749,22.7690); //
    CreatePickup(356,2,-1127.8461,-1495.5160,22.7690); //
    CreatePickup(1240,2,-1128.3176,-1508.9883,15.7777); //
    CreatePickup(1240,2,-1129.9427,-1509.2725,15.7766); //
    CreatePickup(1242,2,-1129.1097,-1517.4158,15.7969); //
    CreatePickup(1242,2,-1143.5594,-1513.2959,15.7969); //
    CreatePickup(1242,2,-1151.3318,-1502.9406,15.7969); //


    AddPlayerClass(0,1107.2589,-1501.5270,15.7969,31.3311,0,0,0,0,0,0); //





    return 1;
    }


    public OnFilterScriptExit()
    {
    return 1;
    }


    #else


    main()
    {
    print("\n----------------------------------");
    print(" Filterscript >>Deathmatch<< by Markus");
    print("----------------------------------\n");
    }


    #endif


    public OnPlayerCommandText(playerid, cmdtext[])
    {
    if (strcmp("/dm", cmdtext, true, 10) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(dm[playerid] == 0)
    {
    if (GetPlayerState(playerid) == 2)
    {
    new tmpcar = GetPlayerVehicleID(playerid);
    SetPlayerPos(playerid,-1434.4117,-15.7969,357.4673);
    TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
    }
    else
    {

    }
    SendClientMessage(playerid, 0xB8860BAA, "***Welcome to the DM!***");
    SetPlayerInterior(playerid,0);
    dm[playerid] =1;
    }
    else if(dm[playerid] ==1)
    {
    if (GetPlayerState(playerid) == 2)
    {
    new tmpcar = GetPlayerVehicleID(playerid);
    SetVehiclePos(tmpcar, 887.0850,61.1224,248.4600);
    TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
    }
    else
    {
    SetPlayerPos(playerid, 887.0850,61.1224,248.4600);
    }
    SendClientMessage(playerid, 0xB8860BAA, "***Welcome back to Racing!***");
    SetPlayerInterior(playerid,0);
    dm[playerid] = 0;
    }
    }
    return 1;
    }
    return 0;
    }


    public OtherTimer()
    {
    for(new i = 0; i < GetMaxPlayers(); i++)
    {
    if(IsPlayerConnected(i))
    {
    if(GetPlayerState(i) == 2)
    {
    GetPlayerPos(i, TelePos[i][3], TelePos[i][4], TelePos[i][5]);
    if(TelePos[i][5] > 550.0)
    {
    TelePos[i][0] = 0.0;
    TelePos[i][1] = 0.0;
    }
    else if(TelePos[i][5] < 550.0 && TelePos[i][3] != 0.0)
    {
    TelePos[i][0] = TelePos[i][3];
    TelePos[i][1] = TelePos[i][4];
    }
    else
    {
    }
    }
    }
    }
    return 1;
    }


    MfG