Removing mapping that's saved to specific user | TXT File!
#1

Alright, I know the title's confusing. But I'm trying to make a furniture system for my gamemode. I'm a semi-new scripter so I my code is very very very unefficient. Anyways, I'm saving the objects like this:
pawn Код:
new string[254];
        OVW = GetPlayerVirtualWorld(playerid);
        OINT = GetPlayerInterior(playerid);
        GetObjectPos(objectid, OX, OY, OZ);
        GetObjectRot(objectid, ORX, ORY, ORZ);
        format(string, sizeof(string), "User: %s", GetName(playerid));
        AddObjectToFile(OBJECT_FILE_NAME, OX, OY, OZ, ORX, ORY, ORZ, OVW, OINT, string);
What I'm trying to figure out is, if a player is to select an object using the SelectObject function, how can I make it remove the object from the file aswell?
Reply
#2

Have you tried using DestroyObject(objectid)?
Reply
#3

Quote:
Originally Posted by aoky
Посмотреть сообщение
Have you tried using DestroyObject(objectid)?
I thought about it, but wouldn't that just delete the object until the server restarts? Does that remove it from the file? Gimme a sec, let me try.
Reply
#4

You should almost also be using the streamer if you're going to have mapping for each player. You'll quickly run up the limit of objects by allowing this in the longer term.

Cool idea though, could be interesting to see how well this pans out in your endeavors of scripting.
Reply
#5

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
You should almost also be using the streamer if you're going to have mapping for each player. You'll quickly run up the limit of objects by allowing this in the longer term.

Cool idea though, could be interesting to see how well this pans out in your endeavors of scripting.
Quote:
Originally Posted by aoky
Посмотреть сообщение
Have you tried using DestroyObject(objectid)?
I am using streamer.
@Aoky, I tried using DestroyObject(objectid) but it doesn't work. It's still there.
Reply
#6

If you're using the streamer, then don't use non-streamer functions...

You should be using CreateDynamicObject, and DestroyDynamicObject.
Reply
#7

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
If you're using the streamer, then don't use non-streamer functions...

You should be using CreateDynamicObject, and DestroyDynamicObject.
I am using CreateDynamicObject and DestroyDynamicObject
Reply
#8

You said prior you were thinking of using it, and thinking of trying it...

You will also need to use the function in the streamer that updates it to make the mapping disappear unless you go out of stream distance and back in again.
Reply
#9

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
You said prior you were thinking of using it, and thinking of trying it...

You will also need to use the function in the streamer that updates it to make the mapping disappear unless you go out of stream distance and back in again.
Think you can help me find it? I'm still looking for that function.
Reply
#10

https://github.com/samp-incognito/sa...treamer_Update

I think this will have something to do with it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)