Removing mapping that's saved to specific user | TXT File! -
oSAINTo - 15.05.2017
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?
Re: Removing mapping that's saved to specific user | TXT File! -
aoky - 15.05.2017
Have you tried using DestroyObject(objectid)?
Re: Removing mapping that's saved to specific user | TXT File! -
oSAINTo - 15.05.2017
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.
Re: Removing mapping that's saved to specific user | TXT File! -
Sew_Sumi - 15.05.2017
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.
Re: Removing mapping that's saved to specific user | TXT File! -
oSAINTo - 15.05.2017
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.
Re: Removing mapping that's saved to specific user | TXT File! -
Sew_Sumi - 15.05.2017
If you're using the streamer, then don't use non-streamer functions...
You should be using CreateDynamicObject, and DestroyDynamicObject.
Re: Removing mapping that's saved to specific user | TXT File! -
oSAINTo - 15.05.2017
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
Re: Removing mapping that's saved to specific user | TXT File! -
Sew_Sumi - 15.05.2017
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.
Re: Removing mapping that's saved to specific user | TXT File! -
oSAINTo - 15.05.2017
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.
Re: Removing mapping that's saved to specific user | TXT File! -
Sew_Sumi - 15.05.2017
https://github.com/samp-incognito/sa...treamer_Update
I think this will have something to do with it.