Jump to content

Welcome to VitalCS Romania
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. If you already have an account, login here - otherwise create an account for free today!
Hosting Recomandat: Lux-host.biz
Buyallsafe.com - CD KEY la cele mai bune preturi !

Toggle shoutbox Shoutbox Open the Shoutbox in a popup

@  Darkness321 : (18 August 2018 - 09:03 PM) Salut
@  Enki : (18 August 2018 - 12:32 PM) Salut !
@  Sasorii : (18 August 2018 - 12:04 PM) Salut
@  Darkness321 : (18 August 2018 - 09:14 AM) @Dănuț
@  Dănuț : (18 August 2018 - 09:11 AM) Salut !
@  Darkness321 : (18 August 2018 - 08:57 AM) :)
@  Enki : (18 August 2018 - 08:56 AM) Am fost la Valea Doftanei mă !
@  Darkness321 : (18 August 2018 - 07:28 AM) neata
@  zEKA : (17 August 2018 - 11:15 PM) @Enki hai ca ai fost si tu pe un deal si zici ca-i munte acolo la tine :))))
@  zEKA : (17 August 2018 - 11:14 PM) @Sasorii paaaaaaaaaaaaaa
@  🐺 NightWolf 🐺 : (17 August 2018 - 11:07 PM) @Sasorii iei sv?
@  Sasorii : (17 August 2018 - 09:45 PM) Seara buna
@  Dănuț : (17 August 2018 - 09:39 PM) Vreau activitate din partea voastră !
@  Enki : (17 August 2018 - 07:31 PM) Scuzati-ma , am fost la munte !
@  Sasorii : (17 August 2018 - 07:28 PM) @zEKa paaaaaaaaaa
@  Darkness321 : (17 August 2018 - 06:58 PM) Salut
@  zEKA : (17 August 2018 - 05:29 PM) @s o n y yacs yes my bitch
@  s o n y : (17 August 2018 - 05:09 PM) @zEKA esti singur? :3
@  s o n y : (17 August 2018 - 05:09 PM) yacs
@  zEKA : (17 August 2018 - 03:16 PM) IIIIIIIIIIIIIIIIIIIIIIIIIIIILLLLLLLLLLLLLLLLLLLL IAAAA SASORIIIIIIIII SLABUUUU?

Photo

[FS]Object Editor


  • This topic is locked This topic is locked
3 replies to this topic

#1
Andy™

Andy™

    RETIRED

  • Membru
  • 1,539 posts

Ingame Object Editor

 

Aveam nevoie de un ObjectEditor usor de folosit ,fara prea multe complicaturi , asa ca am facut unul . Poate mai are nevoie cineva

Comenzi :
/ohelp - vezi toate comenzile fs-ului

/editobject <objectid> - incepe procesul de editare al unui object
/addobject <modelid> - creeaza un object langa tine

/gotoobject <objectid> - te teleporteaza la un anumit obiect
/objects - Afiseaza toate obiectele create pe server*** ( impreuna cu cele existente deja )
/savemap - salveaza toate obiectele in fisierul map.txt

Foloseste sscanf + zcmd

*** Obiectele deja existente nu vor afisa modelul corect(va afisa 0) . Nu exista o functie care sa returneze modelul unui obiect inca 2.gif
qzg3tx.png
Pastebin mirror

 

Fisierulmeu mirror

 

Depositfiles mirror

ZippyShare mirror

 

Vad Ca tot mor linkurile , asa ca postez direct aici codul (pentru ca are foarte putine linii )

#include <a_samp>
#include <zcmd>
#include <sscanf2>
#define culoare 0xFFFFFFAA
new objects;
new objectmodel[500];
forward WriteLog(string[]);
public OnFilterScriptInit()
{
        printf("|------OBJECTS EDITOR--------|");
        printf("|                            |");
        printf("|                            |");
        printf("|                            |");
        printf("|                            |");
        printf("|----------------------------|");
        return 1;
}
COMMAND:addobject(playerid, params[])
{
    new oid,myobject;
        if (!sscanf(params, "i",oid ))
        {
        new string[128];
        new Float:x, Float:y, Float:z;
      GetPlayerPos(playerid, x, y, z);
            myobject = CreateObject(oid, x+2, y+2, z+2, 0.0, 0.0, 90.0);
            format(string, sizeof(string), "CREATED:%d||CreateObject(%d,%f,%f,%f,0.0,0.0,90.0)",myobject,oid,x,y,z);
            SendClientMessage(playerid,culoare,string);
            objectmodel[myobject]=oid;
            objects++;
            return 1;
        }
        else
        {
            SendClientMessage(playerid,culoare,"USE : /addobject [objectid]");
            SendClientMessage(playerid,culoare,"WARNING : Using an wrong id may crash your server");
            return 1;
        }
}
COMMAND:editobject(playerid, params[])
{
    new oid;
        if (!sscanf(params, "i",oid ))
        {
            EditObject(playerid, oid);
            return 1;
        }else{SendClientMessage(playerid,culoare,"USE : /editobject [objectid]");SendClientMessage(playerid,culoare,"INFO :Type /objects for a list of created objects"); return 1;}
 
}
COMMAND:gotoobject(playerid, params[])
{
    new oid;
        if (!sscanf(params, "i",oid ))
        {
            new Float:xo, Float:yo, Float:zo;
            GetObjectPos(oid, xo, yo, zo);
            SetPlayerPos(playerid,xo+1,yo+1,zo+1);
            return 1;
        }else{SendClientMessage(playerid,culoare,"Use :/gotoobject[objectid]"); return 1;}
}
COMMAND:ohelp(playerid,params[])
{
   SendClientMessage(playerid,culoare,"/addobject || /editobject ||/gotoobject || /objects || /savemap");
   SendClientMessage(playerid,culoare,"/oprew");
        return 1;
}
COMMAND:savemap(playerid, params[])
{
    for(new i = 0; i <=500; i++)
    {
       new stringg[128];
       new Float:RotX,Float:RotY,Float:RotZ;
                GetObjectRot(i, RotX, RotY, RotZ);
                new Float:xo, Float:yo, Float:zo;
                GetObjectPos(i, xo, yo, zo);
                if(xo!=0 && yo!=0 && zo!=0)
                {
                format(stringg, sizeof(stringg), "CreateObject(%d,%f,%f,%f,%f,%f,%f);",objectmodel[i],xo,yo,zo,RotX,RotY,RotZ,90);
                WriteLog(stringg);
        }
 
   
}
    new stringg[128];
    format(stringg, sizeof(stringg), "________________//\\_______________");
    WriteLog(stringg);
    SendClientMessage(playerid,culoare,"All Objects have been saved to mapa.txt");
    return 1;
}
COMMAND:objects(playerid, params[])
{
SendClientMessage(playerid,culoare,"___________L I S T______________");
    for(new i = 1; i <=500; i++)
    {
        new stringg[128];
        new Float:RotX,Float:RotY,Float:RotZ;
          GetObjectRot(i, RotX, RotY, RotZ);
                new Float:xo, Float:yo, Float:zo;
                GetObjectPos(i, xo, yo, zo);
                if(xo!=0 && yo!=0 && zo!=0)
                {
               format(stringg, sizeof(stringg), "ID:%dCreateObject(%d,%f,%f,%f,%f,%f,%f);",i,objectmodel[i],xo,yo,zo,RotX,RotY,RotZ);
               SendClientMessage(playerid,culoare,stringg);
                }
 
   
}
    SendClientMessage(playerid,culoare,"________________________________");
    return 1;
}
public WriteLog(string[])
{
        new entry[192];
        format(entry, sizeof(entry), "%s\n",string);
        new File:hFile;
        hFile = fopen("mapa.txt", io_append);
        fwrite(hFile, entry);
        fclose(hFile);
        return 1;
}
public OnPlayerEditObject(playerid, playerobject, objectid, response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ)
{
    if(response == EDIT_RESPONSE_FINAL)
        {
       SetObjectPos(objectid,fX,fY,fZ);
       SetObjectRot(objectid,fRotX,fRotY,fRotZ);
       SendClientMessage(playerid,culoare,"Object Saved");
       return 1;
        }
        return 1;
}


Member since 22 Jan 2014

#2
Kelton

Kelton

    ♦ Banned ♦

  • Membru
  • 269 posts

Eu zic ca este mai simplu cu MTA sau cu Image editor.



#3
skuller32

skuller32

    Începător

  • Membru
  • 1 posts

daca ii dau /savemap si dau un restart, se salveaza datele dar nu si in joc....  a si dupa ce le pozitionez si dau /savemap se salveaza doar datele de la /addobject :(



#4
MarcelV2

MarcelV2

    Membru VitalCS Romania

  • Membru
  • 643 posts

Nu ai respectat modelul + Nu s-a mai postat in acest topic de 7 zile.

:tc:


Posted Image





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users