Virtual World Changer Plus (VWC+)

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
  • Also dies ist ein kleiner Virtual World Changer.


    Man kann allerdings auch das Interéur wechseln,
    Fahrzeuge Spawn,
    Position auslesen,
    Interéur ID auslesen.


    Also nichts besonderes,
    aber hilft vllt beim Entdecken neuer Sachen (Die Übrigbleibsel von GTA (crash datein))


    #include <a_samp>



    #define COLOR_WHITE 0xFFFFFFAA


    #define FILTERSCRIPT


    #if defined FILTERSCRIPT


    public OnFilterScriptInit()
    {
    print(" Virtual World Changer Plus geladen");
    return 1;
    }


    public OnFilterScriptExit()
    {
    return 1;
    }


    #else


    main()
    {
    print("\n----------------------------------");
    print("----------------------------------\n");
    }


    #endif


    stock strtok(const string[], &index,seperator=' ')
    {
    new length = strlen(string);
    new offset = index;
    new result[256];
    while ((index < length) && (string[index] != seperator) && ((index - offset) < (sizeof(result) - 1)))
    {
    result[index - offset] = string[index];
    index++;
    }


    result[index - offset] = EOS;
    if ((index < length) && (string[index] == seperator))
    {
    index++;
    }
    return result;
    }


    public OnGameModeInit()
    {
    // Don't use these lines if it's a filterscript
    return 1;
    }


    public OnGameModeExit()
    {
    return 1;
    }



    public OnPlayerCommandText(playerid, cmdtext[])
    {
    new cmd[256];
    new idx;
    cmd = strtok(cmdtext, idx);


    if (strcmp("/teleport", cmd, true) == 0)
    {
    new worldbonc;
    new tmp[256];
    tmp = strtok(cmdtext, idx);


    if(!strlen(tmp)) {
    SendClientMessage(playerid, COLOR_WHITE, "/teleport [ID]");
    return 1;
    }


    worldbonc = strval(tmp);
    SetPlayerVirtualWorld(playerid, worldbonc);
    return 1;
    }
    if (strcmp("/getpos", cmdtext, true, 6) == 0)
    {
    new Float:x, Float:y, Float:z;
    new str[256];
    GetPlayerPos(playerid, x, y, z);
    format(str, 255, "X: %f Y: %f Z: %f", x, y, z);
    SendClientMessage(playerid, 0xFF0000AA, str);
    return 1;
    }
    if (strcmp("/help", cmdtext, true, 5) == 0)
    {
    SendClientMessage(playerid, 0xFF0000AA, "/teleport [ID] um World zuwechseln");
    SendClientMessage(playerid, 0xFF0000AA, "/getpos um die Koordinate zu erfassen");
    SendClientMessage(playerid, 0xFF0000AA, "/world um die Weltkoords zu erfassen");
    SendClientMessage(playerid, 0xFF0000AA, "/intpos um die Interiorid zu erfassen");
    SendClientMessage(playerid, 0xFF0000AA, "/int [ID] um das Interior zwechseln!");
    SendClientMessage(playerid, 0xFF0000AA, "/spawn [ID] um ein Fahrzeug zuspawnen!");
    return 1;
    }
    if (strcmp("/world", cmdtext, true, 6) == 0)
    {
    new str[256];
    format(str, 255, "World: %i", GetPlayerVirtualWorld(playerid));
    SendClientMessage(playerid, 0xFF0000AA, str);
    return 1;
    }
    if (strcmp("/int", cmd, true) == 0)
    {
    new worldbonc;
    new tmp[256];
    tmp = strtok(cmdtext, idx);


    if(!strlen(tmp)) {
    SendClientMessage(playerid, COLOR_WHITE, "/int [ID]");
    return 1;
    }


    worldbonc = strval(tmp);
    SetPlayerInterior(playerid, worldbonc);
    return 1;
    }
    if (strcmp("/intpos", cmd, true) == 0)
    {
    new position[256];
    format(position, 255, "Intereur: %i", GetPlayerInterior(playerid));
    SendClientMessage(playerid, 0xFF0000AA, position);
    return 1;
    }
    if (strcmp("/spawn", cmd, true) == 0)
    {
    new tmp[256];
    new vehid;
    tmp = strtok(cmdtext, idx);


    if(!strlen(tmp)) {
    SendClientMessage(playerid, 0xFF0000AA, "/spawn [Vehicle ID]");
    return 1;
    }


    vehid = strval(tmp);
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    floatadd(x, 10.0);
    floatadd(y, 10.0);
    CreateVehicle(vehid, x, y, z, 90, 3, 3, -1);
    SendClientMessage(playerid, 0xFF0000AA, "Vehicle gespawnt");
    return 1;
    }
    return 0;
    }


    Neue version:


    #include <a_samp>


    #define FILTERSCRIPT


    #define COLOR_WHITE 0xFFFFFFAA


    #if defined FILTERSCRIPT


    public OnFilterScriptInit()
    {
    print(" Virtual World Changer Plus geladen");
    return 1;
    }


    public OnFilterScriptExit()
    {
    return 1;
    }


    #else


    main()
    {
    print("\n----------------------------------");
    print("----------------------------------\n");
    }


    #endif


    stock strtok(const string[], &index,seperator=' ')
    {
    new length = strlen(string);
    new offset = index;
    new result[256];
    while ((index < length) && (string[index] != seperator) && ((index - offset) < (sizeof(result) - 1)))
    {
    result[index - offset] = string[index];
    index++;
    }


    result[index - offset] = EOS;
    if ((index < length) && (string[index] == seperator))
    {
    index++;
    }
    return result;
    }


    public OnGameModeInit()
    {
    // Don't use these lines if it's a filterscript
    return 1;
    }


    public OnPlayerCommandText(playerid, cmdtext[])
    {
    new cmd[256];
    new idx;
    cmd = strtok(cmdtext, idx);


    if (strcmp("/teleport", cmd, true) == 0)
    {
    new worldbonc;
    new tmp[256];
    tmp = strtok(cmdtext, idx);


    if(!strlen(tmp)) {
    SendClientMessage(playerid, COLOR_WHITE, "/teleport [ID]");
    return 1;
    }

    worldbonc = strval(tmp);
    SetPlayerVirtualWorld(playerid, worldbonc);
    return 1;
    }
    if (strcmp("/getpos", cmdtext, true, 6) == 0)
    {
    new Float:x, Float:y, Float:z;
    new str[256];
    GetPlayerPos(playerid, x, y, z);
    format(str, 255, "X: %f Y: %f Z: %f", x, y, z);
    SendClientMessage(playerid, 0xFF0000AA, str);
    return 1;
    }
    if (strcmp("/help", cmdtext, true, 5) == 0)
    {
    SendClientMessage(playerid, 0xFF0000AA, "/teleport [ID] um World zuwechseln");
    SendClientMessage(playerid, 0xFF0000AA, "/getpos um die Koordinate zu erfassen");
    SendClientMessage(playerid, 0xFF0000AA, "/world um die Weltkoords zu erfassen");
    SendClientMessage(playerid, 0xFF0000AA, "/intpos um die Interiorid zu erfassen");
    SendClientMessage(playerid, 0xFF0000AA, "/int [ID] um das Interior zwechseln!");
    SendClientMessage(playerid, 0xFF0000AA, "/spawn [ID] um ein Fahrzeug zuspawnen!");
    SendClientMessage(playerid, 0xFF0000AA, "/setint [ID] um in ein Intereur zugelangen");
    SendClientMessage(playerid, 0xFF0000AA, "/inthelp um die Intereur Hilfe einzusehn!");
    SendClientMessage(playerid, 0xFF0000AA, "/sethealth [H] um das Leben aufzufrischen ;)");
    return 1;
    }
    if (strcmp("/world", cmdtext, true, 6) == 0)
    {
    new str[256];
    format(str, 255, "World: %i", GetPlayerVirtualWorld(playerid));
    SendClientMessage(playerid, 0xFF0000AA, str);
    return 1;
    }
    if (strcmp("/int", cmd, true) == 0)
    {
    new worldbonc;
    new tmp[256];
    tmp = strtok(cmdtext, idx);


    if(!strlen(tmp)) {
    SendClientMessage(playerid, COLOR_WHITE, "/int [ID]");
    return 1;
    }


    worldbonc = strval(tmp);
    SetPlayerInterior(playerid, worldbonc);
    return 1;
    }
    if (strcmp("/intpos", cmd, true) == 0)
    {
    new position[256];
    format(position, 255, "Intereur: %i", GetPlayerInterior(playerid));
    SendClientMessage(playerid, 0xFF0000AA, position);
    return 1;
    }
    if (strcmp("/spawn", cmd, true) == 0)
    {
    new tmp[256];
    new vehid;
    tmp = strtok(cmdtext, idx);


    if(!strlen(tmp)) {
    SendClientMessage(playerid, 0xFF0000AA, "/spawn [Vehicle ID]");
    return 1;
    }


    vehid = strval(tmp);

    if(400 < vehid && vehid < 611)
    {
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    floatadd(x, 10.0);
    floatadd(y, 10.0);
    CreateVehicle(vehid, x, y, z, 90, 3, 3, -1);
    SendClientMessage(playerid, 0xFF0000AA, "Vehicle gespawnt");
    }
    else
    {
    SendClientMessage(playerid, 0xFF0000AA, "Vehicle ID muss >= 400 und <= 611 sein!");
    }
    return 1;
    }
    if (strcmp("/setint", cmd, true) == 0)
    {
    new tmp[256];
    new intid;
    tmp = strtok(cmdtext, idx);

    if(!strlen(tmp)) {
    SendClientMessage(playerid, 0xFF0000AA, "/setint [ID]");
    return 1;
    }

    intid = strval(tmp);

    switch(intid)
    {
    case 1:
    {
    SetPlayerInterior(playerid, 17);
    SetPlayerPos(playerid, -25.884499, -185.868988, 1003.549988);
    SendClientMessage(playerid, 0xFF0000AA, "Intereur 24/7 1");
    }
    case 2:
    {
    SetPlayerInterior(playerid, 10);
    SetPlayerPos(playerid, 6.091180, -29.271898, 1003.549988);
    SendClientMessage(playerid, 0xFF0000AA, "Intereur 24/7 2");
    }
    case 3:
    {
    SetPlayerInterior(playerid, 18);
    SetPlayerPos(playerid, -30.946699, -89.609596, 1003.549988);
    SendClientMessage(playerid, 0xFF0000AA, "Intereur 24/7 3");
    }
    case 4:
    {
    SetPlayerInterior(playerid, 1);
    SetPlayerPos(playerid, 2.384830, 33.103397, 1199.849976);
    SendClientMessage(playerid, 0xFF0000AA, "Intereur Shamal");
    }
    case 5:
    {
    SetPlayerInterior(playerid, 1);
    SetPlayerPos(playerid, 286.148987, -40.644398, 1001.569946);
    SendClientMessage(playerid, 0xFF0000AA, "Intereur Ammunation");
    }
    case 6:
    {
    SetPlayerInterior(playerid, 10);
    SetPlayerPos(playerid, 246.40, 110.84, 1003.22);
    SendClientMessage(playerid, 0xFF0000AA, "Intereur SF PD");
    }
    case 7:
    {
    SetPlayerInterior(playerid, 12);
    SetPlayerPos(playerid, 2324.33, -1144.79, 1050.71);
    SendClientMessage(playerid, 0xFF0000AA, "Intereur Unused Save House");
    }
    default:
    {
    SendClientMessage(playerid, 0xFF0000AA, "Intereur ID invaild");
    }
    }
    return 1;
    }
    if (strcmp("/inthelp", cmd, true) == 0)
    {
    SendClientMessage(playerid, 0xFF0000AA, "Folgende SetInt ID's:");
    SendClientMessage(playerid, 0xFF0000AA, "1 24/7 Shop 1");
    SendClientMessage(playerid, 0xFF0000AA, "2 24/7 Shop 2");
    SendClientMessage(playerid, 0xFF0000AA, "3 24/7 Shop 3");
    SendClientMessage(playerid, 0xFF0000AA, "4 Shamal Intereur");
    SendClientMessage(playerid, 0xFF0000AA, "5 Ammunation");
    SendClientMessage(playerid, 0xFF0000AA, "6 SF PD");
    SendClientMessage(playerid, 0xFF0000AA, "7 Unbenutztes Speicher Haus");
    return 1;
    }
    if (strcmp("/sethealth", cmd, true) == 0)
    {
    new Float:health;
    new tmp[256];
    tmp = strtok(cmdtext, idx);

    if(!strlen(tmp)) {
    SendClientMessage(playerid, 0xFF0000AA, "/sethealth [0.0-~.~]");
    return 1;
    }

    health = strval(tmp);

    SetPlayerHealth(playerid, health);
    return 1;
    }
    return 0;
    }


    Einmal editiert, zuletzt von DMA ()

  • Nett :)


    Nur ein paar Anmerkungen :X

    format(position, 255, "Intereur: %i", GetPlayerInterior(playerid));

    Ich bin mir nicht sicher ob es die Interior ID richtig zurück gibt.'%i' gibt es soweit ich weiss nicht,stattdessen solltest du mal '%d' benutzten um eine Dezimalzahl in einen String einzufügen.


    Mit /spawn könnte ich das Spiel zum crashen bringen so bald ich eine undefinierte Vehicle Modelid benutzte.
    400-611
    Das solltest du doch leicht überprüfen können ;).


    Kannst dein Script sicherlich noch um einige Features erweitern,wie support für Fahrzeuge beim Interior wechsel oder gleich ein paar Commands um in einige geheime Räume zu gelangen :thumbup:

  • Kommt noch.


    Naja, %i ist für PAWN das selbe wie %d.
    P-Byte Code halt ^^.
    Im Prinziep müsst ich wenn ich korrekt wäre auch schreiben

    Code
    format(position, 255, "Intereur: %i", &GetPlayerInterior(playerid));


    Ich erstell mal eine weitere Version ;)


    Update: Ich hatte keine Lust den code von Quincy in Pawno kompatibilität schreiben
    #include <a_samp>


    #define FILTERSCRIPT


    #pragma tabsize 0


    #define COLOR_WHITE 0xFFFFFFAA


    #if defined FILTERSCRIPT


    public OnFilterScriptInit()
    {
    print(" Virtual World Changer Plus geladen")
    return 1
    }


    public OnFilterScriptExit()
    {
    return 1
    }


    #else


    main()
    {
    }


    #endif


    stock strtok(const string[], &index,seperator=' ')
    {
    new length = strlen(string)
    new offset = index
    new result[256]
    while ((index < length) && (string[index] != seperator) && ((index - offset) < (sizeof(result) - 1)))
    {
    result[index - offset] = string[index]
    index++
    }


    result[index - offset] = EOS
    if ((index < length) && (string[index] == seperator))
    {
    index++
    }
    return result
    }


    public OnGameModeInit()
    {
    // Don't use these lines if it's a filterscript
    return 1
    }


    public OnPlayerCommandText(playerid, cmdtext[])
    {
    new cmd[256]
    new idx
    cmd = strtok(cmdtext, idx)


    if (strcmp("/teleport", cmd, true) == 0)
    {
    new worldbonc
    new tmp[256]
    tmp = strtok(cmdtext, idx)


    if(!strlen(tmp)) {
    SendClientMessage(playerid, COLOR_WHITE, "/teleport [ID]")
    return 1
    }

    worldbonc = strval(tmp)
    SetPlayerVirtualWorld(playerid, worldbonc)
    return 1
    }
    if (strcmp("/getpos", cmdtext, true, 6) == 0)
    {
    new Float:x, Float:y, Float:z
    new str[256]
    GetPlayerPos(playerid, x, y, z)
    format(str, 255, "X: %f Y: %f Z: %f", x, y, z)
    SendClientMessage(playerid, 0xFF0000AA, str)
    return 1
    }
    if (strcmp("/help", cmdtext, true, 5) == 0)
    {
    SendClientMessage(playerid, 0xFF0000AA, "/teleport [ID] um World zuwechseln")
    SendClientMessage(playerid, 0xFF0000AA, "/getpos um die Koordinate zu erfassen")
    SendClientMessage(playerid, 0xFF0000AA, "/world um die Weltkoords zu erfassen")
    SendClientMessage(playerid, 0xFF0000AA, "/intpos um die Interiorid zu erfassen")
    SendClientMessage(playerid, 0xFF0000AA, "/int [ID] um das Interior zwechseln!")
    SendClientMessage(playerid, 0xFF0000AA, "/spawn [ID] um ein Fahrzeug zuspawnen!")
    SendClientMessage(playerid, 0xFF0000AA, "/setint [ID] um in ein Intereur zugelangen")
    SendClientMessage(playerid, 0xFF0000AA, "/inthelp um die Intereur Hilfe einzusehn!")
    SendClientMessage(playerid, 0xFF0000AA, "/sethealth [H] um das Leben aufzufrischen ;)")
    SendClientMessage(playerid, 0xFF0000AA, "/setarmour [A] um die Rstung aufzufrischen ;)")
    return 1
    }
    if (strcmp("/world", cmdtext, true, 6) == 0)
    {
    new str[256];
    format(str, 255, "World: %i", GetPlayerVirtualWorld(playerid))
    SendClientMessage(playerid, 0xFF0000AA, str)
    return 1
    }
    if (strcmp("/int", cmd, true) == 0)
    {
    new worldbonc
    new tmp[256]
    tmp = strtok(cmdtext, idx)


    if(!strlen(tmp)) {
    SendClientMessage(playerid, COLOR_WHITE, "/int [ID]")
    return 1
    }


    worldbonc = strval(tmp)
    SetPlayerInterior(playerid, worldbonc)
    return 1
    }
    if (strcmp("/intpos", cmd, true) == 0)
    {
    new position[256]
    format(position, 255, "Intereur: %i", GetPlayerInterior(playerid))
    SendClientMessage(playerid, 0xFF0000AA, position)
    return 1
    }
    if (strcmp("/spawn", cmd, true) == 0)
    {
    new tmp[256]
    new vehid
    tmp = strtok(cmdtext, idx)


    if(!strlen(tmp)) {
    SendClientMessage(playerid, 0xFF0000AA, "/spawn [Vehicle ID]")
    return 1
    }


    vehid = strval(tmp)

    if(400 < vehid && vehid < 611)
    {
    new Float:x, Float:y, Float:z
    GetPlayerPos(playerid, x, y, z)
    floatadd(x, 10.0)
    floatadd(y, 10.0)
    CreateVehicle(vehid, x, y, z, 90, 3, 3, -1)
    SendClientMessage(playerid, 0xFF0000AA, "Vehicle gespawnt")
    }
    else
    {
    SendClientMessage(playerid, 0xFF0000AA, "Vehicle ID muss >= 400 und <= 611 sein!")
    }
    return 1
    }
    if (strcmp("/setint", cmd, true) == 0)
    {
    new tmp[256]
    new intid
    tmp = strtok(cmdtext, idx)

    if(!strlen(tmp)) {
    SendClientMessage(playerid, 0xFF0000AA, "/setint [ID]")
    return 1
    }

    intid = strval(tmp)

    switch(intid)
    {
    case 1:
    {
    SetPlayerInterior(playerid, 17)
    SetPlayerPos(playerid, -25.884499, -185.868988, 1003.549988)
    SendClientMessage(playerid, 0xFF0000AA, "Intereur 24/7 1")
    }
    case 2:
    {
    SetPlayerInterior(playerid, 10)
    SetPlayerPos(playerid, 6.091180, -29.271898, 1003.549988)
    SendClientMessage(playerid, 0xFF0000AA, "Intereur 24/7 2")
    }
    case 3:
    {
    SetPlayerInterior(playerid, 18)
    SetPlayerPos(playerid, -30.946699, -89.609596, 1003.549988)
    SendClientMessage(playerid, 0xFF0000AA, "Intereur 24/7 3")
    }
    case 4:
    {
    SetPlayerInterior(playerid, 1)
    SetPlayerPos(playerid, 2.384830, 33.103397, 1199.849976)
    SendClientMessage(playerid, 0xFF0000AA, "Intereur Shamal")
    }
    case 5:
    {
    SetPlayerInterior(playerid, 1)
    SetPlayerPos(playerid, 286.148987, -40.644398, 1001.569946)
    SendClientMessage(playerid, 0xFF0000AA, "Intereur Ammunation")
    }
    case 6:
    {
    SetPlayerInterior(playerid, 10)
    SetPlayerPos(playerid, 246.40, 110.84, 1003.22)
    SendClientMessage(playerid, 0xFF0000AA, "Intereur SF PD")
    }
    case 7:
    {
    SetPlayerInterior(playerid, 12)
    SetPlayerPos(playerid, 2324.33, -1144.79, 1050.71)
    SendClientMessage(playerid, 0xFF0000AA, "Intereur Unused Save House")
    }
    default:
    {
    SendClientMessage(playerid, 0xFF0000AA, "Intereur ID invaild")
    }
    }
    return 1
    }
    if (strcmp("/inthelp", cmd, true) == 0)
    {
    SendClientMessage(playerid, 0xFF0000AA, "Folgende SetInt ID's:")
    SendClientMessage(playerid, 0xFF0000AA, "1 24/7 Shop 1")
    SendClientMessage(playerid, 0xFF0000AA, "2 24/7 Shop 2")
    SendClientMessage(playerid, 0xFF0000AA, "3 24/7 Shop 3")
    SendClientMessage(playerid, 0xFF0000AA, "4 Shamal Intereur")
    SendClientMessage(playerid, 0xFF0000AA, "5 Ammunation")
    SendClientMessage(playerid, 0xFF0000AA, "6 SF PD")
    SendClientMessage(playerid, 0xFF0000AA, "7 Unbenutztes Speicher Haus")
    return 1
    }
    if (strcmp("/sethealth", cmd, true) == 0)
    {
    new Float:health
    new tmp[256]
    tmp = strtok(cmdtext, idx)

    if(!strlen(tmp)) {
    SendClientMessage(playerid, 0xFF0000AA, "/sethealth [0.0-~.~]")
    return 1
    }

    health = strval(tmp)

    SetPlayerHealth(playerid, health)
    return 1
    }
    if (strcmp("/setarmour", cmd, true) == 0)
    {
    new Float:armour
    new tmp[256]
    tmp = strtok(cmdtext, idx)

    if(!strlen(tmp)) {
    SendClientMessage(playerid, 0xFF0000AA, "/setarmour [0.0-~.~]")
    return 1
    }

    armour = strval(tmp)
    SetPlayerArmour(playerid, armour)

    return 1
    }
    return 0
    }


    Im Anhang ist die AMX


    3 Mal editiert, zuletzt von DMA ()