AttachObject problem
#1

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!
Reply
#2

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
Reply
#3

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!
Reply
#4

pawn Код:
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
Reply
#5

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
Код:
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 © 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!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)