SA-MP Forums Archive
[HELP] SetPlayerAttachedObject Problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] SetPlayerAttachedObject Problem (/showthread.php?tid=253727)



[HELP] SetPlayerAttachedObject Problem - Sid_Alexander - 07.05.2011

Yea, So i added a command which will get a neon tube on your player,So when he sits in the car, It shows the neon light down of your car, but the problem is, When i sit in the car, It doesnt show the Neon Light, But the player is still holding, And when i type /neon in the car again, The neon light just blinks once. Can anyone help me fix this problem please?


Re: [HELP] SetPlayerAttachedObject Problem - Markx - 07.05.2011

We cant help you without the code.


Re: [HELP] SetPlayerAttachedObject Problem - Sid_Alexander - 07.05.2011

here is the code :
Код:
    if(strcmp(cmd, "/neon", true) == 0) {
		 SetPlayerAttachedObject(playerid, 3, 18649,3,0.1,0.1,-0.1,0.0,270.0,0.0);
         return 1;
    }



Re: [HELP] SetPlayerAttachedObject Problem - BizzyD - 07.05.2011

Hmm, Let me get this straight? Do you want so people can get neon inside their car?

Why dont use AttachObjectToVehicle

EDIT: Oh now i get it after seeing your code.

NVM then


Re: [HELP] SetPlayerAttachedObject Problem - Sid_Alexander - 07.05.2011

Код:
if(strcmp(cmd, "/neon", true) == 0) {
		 AttachObjectToVehicle(playerid, 18649,3,0.1,0.1,-0.1,0.0,270.0,0.0);
         return 1;
    }
Warning :
Код:
D:\Games\Desktop\Overseas RolePlay\gamemodes\OSRP.pwn(29853) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase

Header size:          10888 bytes
Code size:          1679764 bytes
Data size:         10383536 bytes
Stack/heap size:      16384 bytes; estimated max. usage=4473 cells (17892 bytes)
Total requirements:12090572 bytes

1 Warning.



Re: [HELP] SetPlayerAttachedObject Problem - BizzyD - 07.05.2011

Look at samp wiki how to do it. Click me And you will see how you should do.


Re: [HELP] SetPlayerAttachedObject Problem - Sid_Alexander - 07.05.2011

Quote:
Originally Posted by AlexzzPro
Посмотреть сообщение
Look at samp wiki how to do it. Click me And you will see how you should do.
Can you provide the complete code please?


Re: [HELP] SetPlayerAttachedObject Problem - MadeMan - 07.05.2011

pawn Код:
new objectid = CreateObject(18649, 0, 0, 0, 0, 0, 0);
AttachObjectToVehicle(objectid, GetPlayerVehicleID(playerid), 0.1,0.1,-0.1,0.0,270.0,0.0);



Re: [HELP] SetPlayerAttachedObject Problem - Sid_Alexander - 07.05.2011

Now What?
Код:
D:\Games\Desktop\Overseas RolePlay\gamemodes\OSRP.pwn(29853) : error 003: declaration of a local variable must appear in a compound block
D:\Games\Desktop\Overseas RolePlay\gamemodes\OSRP.pwn(29853) : error 017: undefined symbol "objectid"
D:\Games\Desktop\Overseas RolePlay\gamemodes\OSRP.pwn(29854) : error 017: undefined symbol "objectid"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.



Re: [HELP] SetPlayerAttachedObject Problem - MadeMan - 07.05.2011

Quote:
Originally Posted by Sid_Alexander
Посмотреть сообщение
Now What?
Код:
D:\Games\Desktop\Overseas RolePlay\gamemodes\OSRP.pwn(29853) : error 003: declaration of a local variable must appear in a compound block
D:\Games\Desktop\Overseas RolePlay\gamemodes\OSRP.pwn(29853) : error 017: undefined symbol "objectid"
D:\Games\Desktop\Overseas RolePlay\gamemodes\OSRP.pwn(29854) : error 017: undefined symbol "objectid"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Do you have it like this?

pawn Код:
if(strcmp(cmd, "/neon", true) == 0) {
    new objectid = CreateObject(18649, 0, 0, 0, 0, 0, 0);
    AttachObjectToVehicle(objectid, GetPlayerVehicleID(playerid), 0.1,0.1,-0.1,0.0,270.0,0.0);
    return 1;
}