Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Mohamed Boubekri on Apr 15, 2018, 02:42 PM

Title: Pickup.Remove() Problem
Post by: Mohamed Boubekri on Apr 15, 2018, 02:42 PM
Hello, I know pickup.Remove() its working but, when i do it for my server say me error index "Remove" lol :'(
i'm using rel004 with latest update.
Anyway how to fix the chit?
FindPickup( text.tointeger() ).Remove();(https://i62.servimg.com/u/f62/19/76/34/14/captur14.png)
Title: Re: Pickup.Remove() Problem
Post by: Mahmoud Tornado on Apr 15, 2018, 03:27 PM
I don't know but try to make local.

local pickup = FindPickup( text.tointeger() )
pickup.Remove();
Title: Re: Pickup.Remove() Problem
Post by: Mohamed Boubekri on Apr 15, 2018, 03:33 PM
Quote from: Mahmoud Tornado on Apr 15, 2018, 03:27 PMI don't know but try to make local.

local pickup = FindPickup( text.tointeger() )
pickup.Remove();
Already do it, But Still Not Working.
Title: Re: Pickup.Remove() Problem
Post by: Mahmoud Tornado on Apr 15, 2018, 03:37 PM
Quote from: Mohamed on Apr 15, 2018, 03:33 PM
Quote from: Mahmoud Tornado on Apr 15, 2018, 03:27 PMI don't know but try to make local.

local pickup = FindPickup( text.tointeger() )
pickup.Remove();
Already do it, But Still Not Working.
Could you show me the command?
Title: Re: Pickup.Remove() Problem
Post by: Mohamed Boubekri on Apr 15, 2018, 03:40 PM
Quote from: Mahmoud Tornado on Apr 15, 2018, 03:37 PM
Quote from: Mohamed on Apr 15, 2018, 03:33 PM
Quote from: Mahmoud Tornado on Apr 15, 2018, 03:27 PMI don't know but try to make local.

local pickup = FindPickup( text.tointeger() )
pickup.Remove();
Already do it, But Still Not Working.
Could you show me the command?
No :P
Title: Re: Pickup.Remove() Problem
Post by: Mahmoud Tornado on Apr 15, 2018, 03:42 PM
Quote from: Mohamed on Apr 15, 2018, 03:40 PM
Quote from: Mahmoud Tornado on Apr 15, 2018, 03:37 PM
Quote from: Mohamed on Apr 15, 2018, 03:33 PM
Quote from: Mahmoud Tornado on Apr 15, 2018, 03:27 PMI don't know but try to make local.

local pickup = FindPickup( text.tointeger() )
pickup.Remove();
Already do it, But Still Not Working.
Could you show me the command?
No :P
Okay, I was trying to help anyway. :P
Title: Re: Pickup.Remove() Problem
Post by: Mohamed Boubekri on Apr 15, 2018, 03:43 PM
Quote from: Mahmoud Tornado on Apr 15, 2018, 03:42 PM
Quote from: Mohamed on Apr 15, 2018, 03:40 PM
Quote from: Mahmoud Tornado on Apr 15, 2018, 03:37 PM
Quote from: Mohamed on Apr 15, 2018, 03:33 PM
Quote from: Mahmoud Tornado on Apr 15, 2018, 03:27 PMI don't know but try to make local.

local pickup = FindPickup( text.tointeger() )
pickup.Remove();
Already do it, But Still Not Working.
Could you show me the command?
No :P
Okay, I was trying to help anyway. :P
i'm Sure The Problem Are not on the Command because command is /delpickup <ID>
so problem is in first post :P :) :(
Title: Re: Pickup.Remove() Problem
Post by: Mahmoud Tornado on Apr 15, 2018, 03:47 PM
Quote from: Mohamed on Apr 15, 2018, 03:43 PM
Quote from: Mahmoud Tornado on Apr 15, 2018, 03:42 PM
Quote from: Mohamed on Apr 15, 2018, 03:40 PM
Quote from: Mahmoud Tornado on Apr 15, 2018, 03:37 PM
Quote from: Mohamed on Apr 15, 2018, 03:33 PM
Quote from: Mahmoud Tornado on Apr 15, 2018, 03:27 PMI don't know but try to make local.

local pickup = FindPickup( text.tointeger() )
pickup.Remove();
Already do it, But Still Not Working.
Could you show me the command?
No :P
Okay, I was trying to help anyway. :P
i'm Sure The Problem Are not on the Command because command is /delpickup <ID>
so problem is in first post :P :) :(
I think if you using my system you must change it as I didn't add pickup IDs.
Title: Re: Pickup.Remove() Problem
Post by: Saiyan Attack on Apr 15, 2018, 03:59 PM
here it goes :-
else if (cmd == "deletepickup") {
if(!text) PrivMessage(player,"Syntax Error /"+cmd+" <pickup/id>");
else if (!IsNum(text)) PrivMessage(player,"pickup/id must be in numbers");
else {
local pick = FindPlayer(text.tointeger());
if(!pick) PrivMessage(player,"pickup/id doesn't exist in server!");
else {
PrivMessage(player, "pickup ID "+pick.ID+" Removed from server");
pick.Remove();
}
}
}
Title: Re: Pickup.Remove() Problem
Post by: Mohamed Boubekri on Apr 15, 2018, 03:59 PM
Quote from: Mahmoud Tornado on Apr 15, 2018, 03:47 PM
Quote from: Mohamed on Apr 15, 2018, 03:43 PM
Quote from: Mahmoud Tornado on Apr 15, 2018, 03:42 PM
Quote from: Mohamed on Apr 15, 2018, 03:40 PM
Quote from: Mahmoud Tornado on Apr 15, 2018, 03:37 PM
Quote from: Mohamed on Apr 15, 2018, 03:33 PM
Quote from: Mahmoud Tornado on Apr 15, 2018, 03:27 PMI don't know but try to make local.

local pickup = FindPickup( text.tointeger() )
pickup.Remove();
Already do it, But Still Not Working.
Could you show me the command?
No :P
Okay, I was trying to help anyway. :P
i'm Sure The Problem Are not on the Command because command is /delpickup <ID>
so problem is in first post :P :) :(
I think if you using my system you must change it as I didn't add pickup IDs.
But i have added IDs.
Title: Re: Pickup.Remove() Problem
Post by: Mohamed Boubekri on Apr 15, 2018, 04:00 PM
Quote from: Saiyan Attack on Apr 15, 2018, 03:59 PMhere it goes :-
else if (cmd == "deletepickup") {
if(!text) PrivMessage(player,"Syntax Error /"+cmd+" <pickup/id>");
else if (!IsNum(text)) PrivMessage(player,"pickup/id must be in numbers");
else {
local pick = FindPlayer(text.tointeger());
if(!pick) PrivMessage(player,"pickup/id doesn't exist in server!");
else {
PrivMessage(player, "pickup ID "+pick.ID+" Removed from server");
pick.Remove();
}
}
}
local pick = FindPlayer(text.tointeger());To
local pick = FindPickup(text.tointeger());
P.S:- i have same the code but still not working.
Title: Re: Pickup.Remove() Problem
Post by: Saiyan Attack on Apr 15, 2018, 04:05 PM
Quote from: Mohamed on Apr 15, 2018, 04:00 PM
Quote from: Saiyan Attack on Apr 15, 2018, 03:59 PMhere it goes :-
else if (cmd == "deletepickup") {
if(!text) PrivMessage(player,"Syntax Error /"+cmd+" <pickup/id>");
else if (!IsNum(text)) PrivMessage(player,"pickup/id must be in numbers");
else {
local pick = FindPlayer(text.tointeger());
if(!pick) PrivMessage(player,"pickup/id doesn't exist in server!");
else {
PrivMessage(player, "pickup ID "+pick.ID+" Removed from server");
pick.Remove();
}
}
}
local pick = FindPlayer(text.tointeger());To
local pick = FindPickup(text.tointeger());
P.S:- i have same the code but still not working.
writing from phone something become wrong as i think :P but you correct it try to use this cmd and tell me the output ...
Title: Re: Pickup.Remove() Problem
Post by: Mohamed Boubekri on Apr 15, 2018, 04:13 PM
Quote from: Mahmoud Tornado on Apr 15, 2018, 03:37 PM
Quote from: Mohamed on Apr 15, 2018, 03:33 PM
Quote from: Mahmoud Tornado on Apr 15, 2018, 03:27 PMI don't know but try to make local.

local pickup = FindPickup( text.tointeger() )
pickup.Remove();
Already do it, But Still Not Working.
Could you show me the command?
Here it is:- ( Problem is in "Remove" )
else if( cmd == "removepickup" )
{
if ( !text ) pMSG("[INFO][#ffffff] /"+cmd+" <ID>", player );
else {
MessagePlayer("[#fff123][PICKUP][#ffffff] You have removed the pickup",player);
QuerySQL( sqliteDB, "DELETE FROM PickUpArmour WHERE ID='"+text.tointeger()+"'" );
FindPickup( text.tointeger() ).Remove();
}
}
Title: Re: Pickup.Remove() Problem
Post by: Saiyan Attack on Apr 15, 2018, 04:35 PM
else if( cmd == "removepickup" )
{
if ( !text ) pMSG("[INFO][#ffffff] /"+cmd+" <ID>", player );
else if (!IsNum(text)) PrivMessage(player,"pickup/id must be in numbers");
else {
local pick = FindPickup(text.tointeger());
if(!pick) PrivMessage(player,"pickup/id doesn't exist in server!");
else {
MessagePlayer("[#fff123][PICKUP][#ffffff] You have removed the pickup",player);
QuerySQL( sqliteDB, "DELETE FROM PickUpArmour WHERE ID='"+pick.ID+"'" );
pick.Remove();
}
}
}
Title: Re: Pickup.Remove() Problem
Post by: . on Apr 15, 2018, 04:35 PM
try {
    FindPickup( text.tointeger() ).Remove();
} catch (e) {
    print("Can't deal with it now!");
}
Title: Re: Pickup.Remove() Problem
Post by: Mohamed Boubekri on Apr 15, 2018, 06:03 PM
The problem was in database when i was save pickup i was save it with ID getpickupcount+1
but when i join game & i delete the pickup its deleted only from data but its not delete from prop
i just change the line in the command /savepickup to getpickupcount.
Solved. @Mohamed