Pickup.Remove() Problem

Started by Mohamed Boubekri, Apr 15, 2018, 02:42 PM

Previous topic - Next topic

Mohamed Boubekri

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();
| What now ? | Not yet ! |
Morrocan:- [ 🇲🇦 ].

Mahmoud Tornado

I don't know but try to make local.

local pickup = FindPickup( text.tointeger() )
pickup.Remove();

Mohamed Boubekri

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.
| What now ? | Not yet ! |
Morrocan:- [ 🇲🇦 ].

Mahmoud Tornado

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?

Mohamed Boubekri

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
| What now ? | Not yet ! |
Morrocan:- [ 🇲🇦 ].

Mahmoud Tornado

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

Mohamed Boubekri

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 :) :(
| What now ? | Not yet ! |
Morrocan:- [ 🇲🇦 ].

Mahmoud Tornado

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.

Saiyan Attack

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();
}
}
}

Mohamed Boubekri

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.
| What now ? | Not yet ! |
Morrocan:- [ 🇲🇦 ].

Mohamed Boubekri

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.
| What now ? | Not yet ! |
Morrocan:- [ 🇲🇦 ].

Saiyan Attack

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 ...

Mohamed Boubekri

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();
}
}
| What now ? | Not yet ! |
Morrocan:- [ 🇲🇦 ].

Saiyan Attack

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();
}
}
}

.

#14
try {
    FindPickup( text.tointeger() ).Remove();
} catch (e) {
    print("Can't deal with it now!");
}
.