script newbie

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
  • moin leute, ich "scripte" jetzt fast 3 stunden und schaffe es nicht das das lspd tor sich bewegt.


    // This is a comment
    // uncomment the line below if you want to write a filterscript
    #define FILTERSCRIPT


    #include <a_samp>


    #if defined FILTERSCRIPT
    #define COLOR_YELLOW 0xFFFF00AA
    public OnFilterScriptInit()
    {
    print("\n--------------------------------------");
    print(" lspd by mike");
    print("--------------------------------------\n");
    return 1;
    }


    public OnFilterScriptExit()
    {
    return 1;
    }


    #else


    main()
    {
    print("\n----------------------------------");
    print(" hf und so");
    print("----------------------------------\n");
    }


    #endif


    public OnGameModeInit()
    {
    // Don't use these lines if it's a filterscript
    SetGameModeText("Teste");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    CreateObject(2909, 1544.7381591797, -1626.9291992188, 13.689222335815, 0, 0, 0); // das Tor
    CreateObject(2933, 1544.7269287109, -1618.2950439453, 14.270176887512, 0, 0, 90); // Zaun
    CreateObject(2933, 1543.9080810547, -1637.060546875, 13.947222709656, 0, 0, 88); // Zaun 1
    return 1;
    }


    public OnGameModeExit()
    {
    return 1;
    }


    public OnPlayerRequestClass(playerid, classid)
    {
    SetPlayerPos(playerid, 11958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    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 OnPlayerCommandText(playerid, cmdtext[])
    {
    if (strcmp(cmdtext, "/pdo", true) == 0)
    {
    MoveObject(2909,1544.7811279297, 0, 0, 0);
    SendClientMessage(playerid, COLOR_YELLOW,"Tor öffnet sich.");
    return 1;
    }
    if (strcmp(cmdtext, "/pdc", true) == 0)
    {
    MoveObject(2909,1544.7381591797, 0, 0, 0);
    SendClientMessage(playerid, COLOR_YELLOW, "Du hast das LSPD-Tor geschlossen.");
    return 1;
    }
    return 0;
    }


    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 OnPlayerRequestSpawn(playerid)
    {
    return 1;
    }


    public OnObjectMoved(objectid)
    {
    return 1;
    }


    public OnPlayerObjectMoved(playerid, objectid)
    {
    return 1;
    }


    public OnPlayerPickUpPickup(playerid, pickupid)
    {
    return 1;
    }


    public OnVehicleMod(playerid, vehicleid, componentid)
    {
    return 1;
    }


    public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
    {
    return 1;
    }


    public OnVehicleRespray(playerid, vehicleid, color1, color2)
    {
    return 1;
    }


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


    public OnPlayerExitedMenu(playerid)
    {
    return 1;
    }


    public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
    {
    return 1;
    }


    public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
    {
    return 1;
    }


    public OnRconLoginAttempt(ip[], password[], success)
    {
    return 1;
    }


    public OnPlayerUpdate(playerid)
    {
    return 1;
    }


    public OnPlayerStreamIn(playerid, forplayerid)
    {
    return 1;
    }


    public OnPlayerStreamOut(playerid, forplayerid)
    {
    return 1;
    }


    public OnVehicleStreamIn(vehicleid, forplayerid)
    {
    return 1;
    }


    public OnVehicleStreamOut(vehicleid, forplayerid)
    {
    return 1;
    }


    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {
    return 1;
    }


    public OnPlayerClickPlayer(playerid, clickedplayerid, source)
    {
    return 1;
    }


    wenn ich die comands eingebe kommt zwar der text aber sonst passiert nichts.


    vl könnt ihr mir helfen.

  • ganz oben


    new Test;

    Unter Gamemodeinit


    Test = CreateObject(2909,..........

    Movecommand


    MoveObjext(Test, Koords);

    So :D


    schau dir Tut ´s an


  • 1 Object createn (wie PasMod es gemacht hat)


    2 Die move cords (einfach das tor unter die map oder über die map oder zur seite setzen und koords speichern)


    MfG


    Ich übernehme keine Verantwortung für sämtliches Bild oder Ton Material meiner Beiträge oder meiner Signatur.
    Ich übernehme keine Verantwortung für die Richtigkeit oder Aktualität meiner Beiträge oder Signatur!




    Selfmade Signature <3

    http://www.youtube.com/user/NMasterHD



  • also ich hab einmal koords wo schranken zu is und einmal wo offen, hab script neu gespeichert compiliert aber jetzt is der schranken da, wenn ich /lso dann fährt der schranken schräg in den boden und mit /lsc passiert nichts mehr.


    hier der code :
    // This is a comment
    // uncomment the line below if you want to write a filterscript
    #define FILTERSCRIPT


    #include <a_samp>


    #if defined FILTERSCRIPT
    #define COLOR_YELLOW 0xFFFF00AA


    new schranken;


    public OnFilterScriptInit()
    {
    print("\n--------------------------------------");
    print(" lspd by mike");
    print("--------------------------------------\n");
    return 1;
    }


    public OnFilterScriptExit()
    {
    return 1;
    }


    #else


    main()
    {
    print("\n----------------------------------");
    print(" hf und so");
    print("----------------------------------\n");
    }


    #endif


    public OnGameModeInit()
    {
    // Don't use these lines if it's a filterscript
    SetGameModeText("LSPD by mikee");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    schranken = CreateObject(968, 1544.7036132813, -1630.7706298828, 13.120311737061, 0, 268, 269.99450683594);// der schranken
    CreateObject(2933, 1544.7269287109, -1618.2950439453, 14.270176887512, 0, 0, 90); // Zaun
    CreateObject(2933, 1543.9080810547, -1637.060546875, 13.947222709656, 0, 0, 88); // Zaun 1
    AddStaticVehicle(411, 1548.837890625, -1621.716796875, 13.346875190735, 0, 0, 90);//infernus
    return 1;
    }


    public OnGameModeExit()
    {
    return 1;
    }


    public OnPlayerRequestClass(playerid, classid)
    {
    SetPlayerPos(playerid, 11958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    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 OnPlayerCommandText(playerid, cmdtext[])
    {
    if (strcmp(cmdtext, "/lso", true) == 0)
    {
    MoveObject(schranken, 968, 1544.7036132813, -1630.7706298828, 13.120311737061, 0, 0, 269.99450683594); //hier 0, 0, die zweite null stellt den schranken da wenn er geschlossen ist.


    SendClientMessage(playerid, COLOR_YELLOW,"Du hast das LSPD-Tor geöffnet");
    return 1;
    }
    if (strcmp(cmdtext, "/lsc", true) == 0)
    {
    MoveObject(schranken, 968, 1544.7036132813, -1630.7706298828, 13.120311737061, 0, 268, 269.99450683594); // hier die 0, 268, stellt ihn da wie er geöffnet is, aber soweit kommts nicht ..


    SendClientMessage(playerid, COLOR_YELLOW, "Du hast das LSPD-Tor geschlossen.");
    return 1;
    }
    return 0;
    }


    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 OnPlayerRequestSpawn(playerid)
    {
    return 1;
    }


    public OnObjectMoved(objectid)
    {
    return 1;
    }


    public OnPlayerObjectMoved(playerid, objectid)
    {
    return 1;
    }


    public OnPlayerPickUpPickup(playerid, pickupid)
    {
    return 1;
    }


    public OnVehicleMod(playerid, vehicleid, componentid)
    {
    return 1;
    }


    public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
    {
    return 1;
    }


    public OnVehicleRespray(playerid, vehicleid, color1, color2)
    {
    return 1;
    }


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


    public OnPlayerExitedMenu(playerid)
    {
    return 1;
    }


    public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
    {
    return 1;
    }


    public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
    {
    return 1;
    }


    public OnRconLoginAttempt(ip[], password[], success)
    {
    return 1;
    }


    public OnPlayerUpdate(playerid)
    {
    return 1;
    }


    public OnPlayerStreamIn(playerid, forplayerid)
    {
    return 1;
    }


    public OnPlayerStreamOut(playerid, forplayerid)
    {
    return 1;
    }


    public OnVehicleStreamIn(vehicleid, forplayerid)
    {
    return 1;
    }


    public OnVehicleStreamOut(vehicleid, forplayerid)
    {
    return 1;
    }


    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {
    return 1;
    }


    public OnPlayerClickPlayer(playerid, clickedplayerid, source)
    {
    return 1;
    }

    Einmal editiert, zuletzt von mikeee ()