SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 14/06/2009, 06:34 PM   #1
Bas_NL
Little Clucker
 
Join Date: May 2006
Posts: 19
Reputation: 0
Default AttachObject problem

Hey, i have a AttachObjectToPlayer problem. Here is the pastebin. When i choose the bush/tree/stone from the menu, it just doesnt show up. I have no idea what i am doing wrong. As you can see in the script, i tried serveral things:

http://pastebin.com/mf4cb879

Thanks in advance!
Bas_NL is offline  
Old 14/06/2009, 06:40 PM   #2
dice7
High-roller
 
Join Date: Apr 2009
Location: Slovenia
Posts: 2,200
Reputation: 22
Default Re: AttachObject problem

You need to create the object first and then attach it. Also, create the objects in arrays, so 2 players can have each his own rock attached. And don't forget destroying the object at the end
dice7 is offline  
Old 14/06/2009, 07:10 PM   #3
Bas_NL
Little Clucker
 
Join Date: May 2006
Posts: 19
Reputation: 0
Default Re: AttachObject problem

Ok dice7, thanks alot for your reply, its working now.

But now there is another problem:
How can the objects be destoryed again when you die/buy an other object/camouflage? I already have it a bit in mind, but can somebody give me an example how it can be destoryed when you die or buy another one? Very much thanks in advance!
Bas_NL is offline  
Old 14/06/2009, 08:29 PM   #4
dice7
High-roller
 
Join Date: Apr 2009
Location: Slovenia
Posts: 2,200
Reputation: 22
Default Re: AttachObject problem

pawn Code:
public OnPlayerDeath(playerid, reason)
{
DestroyObject(whatever goes in here)
}
And when he buys another one, you just destroy all the others except the one he just bought, even though they may not exist
dice7 is offline  
Old 15/06/2009, 08:40 PM   #5
Bas_NL
Little Clucker
 
Join Date: May 2006
Posts: 19
Reputation: 0
Default Re: AttachObject problem

Damn, i have some weird problem. Its not working!

I seperated the camouflageshopthing from the weapons. The weapons are fine. But when i join the server for the first time, and i choose ''tree'', i get the tree camouflage, but i dont lose money (?). Then when i buy an other camouflage, there are 2 problems. 1 it doesnt show up 2. the tree doesnt get destroyed.

And when i rejoin the server, and i choose for the tree, i do get the message, but i dont lose money and i dont get the tree camouflage. I really dont know what i am doing wrong. Please help me.

Pastebin: http://pastebin.com/m1a1ae49f
Code:
C:\Users\Joop\Documents\Bas\server\samp\filterscripts\camouflageshop.pwn(60) : warning 202: number of arguments does not match definition
C:\Users\Joop\Documents\Bas\server\samp\filterscripts\camouflageshop.pwn(75) : warning 213: tag mismatch
C:\Users\Joop\Documents\Bas\server\samp\filterscripts\camouflageshop.pwn(75) : warning 202: number of arguments does not match definition
C:\Users\Joop\Documents\Bas\server\samp\filterscripts\camouflageshop.pwn(107) : warning 217: loose indentation
C:\Users\Joop\Documents\Bas\server\samp\filterscripts\camouflageshop.pwn(115) : warning 217: loose indentation
C:\Users\Joop\Documents\Bas\server\samp\filterscripts\camouflageshop.pwn(117) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


6 Warnings.
And dice7, i really appreciate your help And sorry for my noobish-it-thing, but i am new to pawn and i really want to learn it, and understand it. Thanks in advance!
Bas_NL is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
AttachObject then move it misko28 Help Archive 4 11/05/2010 03:58 PM


All times are GMT. The time now is 02:56 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.