Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: [VM_U]Spectra.PhantoM^ on Feb 19, 2016, 04:32 AM

Title: Pickup help.
Post by: [VM_U]Spectra.PhantoM^ on Feb 19, 2016, 04:32 AM
when someone picksup a pickup it gives him money but he can pick it again. i want it to not be available to the one who has picked it. also i want the pickup to respawn
Title: Re: Pickup help.
Post by: Xmair on Feb 19, 2016, 04:59 AM
Show us the code.
Title: Re: Pickup help.
Post by: [VM_U]Spectra.PhantoM^ on Feb 19, 2016, 05:01 AM
if (pickup.Model == 356)
{
player.Cash += 1000;
MessagePlayer("You've Found The Treasure!", player);
Pickup.Remove;
}
}

here
Title: Re: Pickup help.
Post by: Cenz Tom on Feb 19, 2016, 05:30 AM
Maybe Use That pickup.RespawnTime = 999999999999999;
Title: Re: Pickup help.
Post by: KAKAN on Feb 19, 2016, 05:49 AM
Quote from: {ultimatejugo] on Feb 19, 2016, 05:01 AMif (pickup.Model == 356)
{
player.Cash += 1000;
MessagePlayer("You've Found The Treasure!", player);
Pickup.Remove;
}
}

here
Remove is a function I guess, so use: pickup.Remove()
Title: Re: Pickup help.
Post by: [VM_U]Spectra.PhantoM^ on Feb 19, 2016, 06:44 AM
Quote from: KAKAN on Feb 19, 2016, 05:49 AM
Quote from: {ultimatejugo] on Feb 19, 2016, 05:01 AMif (pickup.Model == 356)
{
player.Cash += 1000;
MessagePlayer("You've Found The Treasure!", player);
Pickup.Remove;
}
}

here
Remove is a function I guess, so use: pickup.Remove()
thats the thing the pickup doesnt get removed
Title: Re: Pickup help.
Post by: [Elv]Woodland on Feb 19, 2016, 06:47 AM
Quote from: KAKAN on Feb 19, 2016, 05:49 AMRemove is a function I guess, so use: pickup.Remove()

Its pickup.Remove(); @kakan :P
you forgot to add " ; "

ultimatejugo try like this, pickup.Remove();
Title: Re: Pickup help.
Post by: Xmair on Feb 19, 2016, 06:51 AM
Pickup.Remove();
pickup.Remove(); // Since squirrel is a case sensitive language, or try pickup.RespawnTime = 5000;
// Time in milliseconds.
Title: Re: Pickup help.
Post by: KAKAN on Feb 19, 2016, 08:05 AM
Quote from: Woodland on Feb 19, 2016, 06:47 AM
Quote from: KAKAN on Feb 19, 2016, 05:49 AMRemove is a function I guess, so use: pickup.Remove()

Its pickup.Remove(); @kakan :P
you forgot to add " ; "

ultimatejugo try like this, pickup.Remove();

Quote from: Xmair on Feb 19, 2016, 06:51 AMPickup.Remove();
pickup.Remove(); // Since squirrel is a case sensitive language, or try pickup.RespawnTime = 5000;
// Time in milliseconds.
Well, the thing, semicolon( ';' ) is not needed. I have many things without ';' and they work. @Xmair, I did the same.
Quote from: {ultimateretard on Feb 19, 2016, 06:44 AM
Quote from: KAKAN on Feb 19, 2016, 05:49 AMRemove is a function I guess, so use: pickup.Remove()
thats the thing the pickup doesnt get removed

Well, you use the function as a variable, then how do you expect it to work, huh?

Well, this is the code, use it, or get rekt.
if (pickup.Model == 356)
{
player.Cash += 1000;
MessagePlayer("You've Found The SHITTY Treasure!", player);
Pickup.Remove();
}
Title: Re: Pickup help.
Post by: FarisDon on Feb 19, 2016, 10:49 AM
Quote from: KAKAN on Feb 19, 2016, 08:05 AM
Quote from: Woodland on Feb 19, 2016, 06:47 AM
Quote from: KAKAN on Feb 19, 2016, 05:49 AMRemove is a function I guess, so use: pickup.Remove()

Its pickup.Remove(); @kakan :P
you forgot to add " ; "

ultimatejugo try like this, pickup.Remove();

Quote from: Xmair on Feb 19, 2016, 06:51 AMPickup.Remove();
pickup.Remove(); // Since squirrel is a case sensitive language, or try pickup.RespawnTime = 5000;
// Time in milliseconds.
Well, the thing, semicolon( ';' ) is not needed. I have many things without ';' and they work. @Xmair, I did the same.
Quote from: {ultimateretard on Feb 19, 2016, 06:44 AM
Quote from: KAKAN on Feb 19, 2016, 05:49 AMRemove is a function I guess, so use: pickup.Remove()
thats the thing the pickup doesnt get removed

Well, you use the function as a variable, then how do you expect it to work, huh?

Well, this is the code, use it, or get rekt.
if (pickup.Model == 356)
{
player.Cash += 1000;
MessagePlayer("You've Found The SHITTY Treasure!", player);
Pickup.Remove();
}
:( Kakan, why wrong?
Pickup.Remove doesn't even exist :|
Ultimate change Pickup.Remove(); to pickup.Remove();like this
if (pickup.Model == 356)
{
player.Cash += 1000;
MessagePlayer("You've Found The Treasure!", player);
pickup.Remove();
}
}
since you didn't even defined Pickup*
P.S : - in simple word, P isn't defined anywhere.
Yeah it could be local Pickup = FindPickup( pickup.ID );then we can say Pickup.Remove(); is still kinda correct.