SA-MP Forums Archive
AttachObject [HELP] - 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)
+--- Thread: AttachObject [HELP] (/showthread.php?tid=501496)



AttachObject [HELP] - LazyGamer99 - 18.03.2014

Hello there, does anyone know how could i set attach object to player if it's holding 10k? I want to add briefcase to player if it's holding 10k or more, so i was searching how to do it, but it didn't help.

This is my script code, please don't judge me, i am noob and btw, it's ZCMD
Quote:

stock Briefcase(objectid, playerid, Float:OffsetX, Float:OffsetY, Float:OffsetZ, Float:rX, Float:rY, Float:rZ)
{
if(PlayerLogged[playerid] == 0) return 1;
if(GetMoney(playerid) < 10000);
SetPlayerHoldingObject(playerid, 1210, 5, 0, 0, 0)
if(GetMoney(playerid) > 10000);
StopPlayerHoldingObject(playerid)
return 1;
}




Re: AttachObject [HELP] - LazyGamer99 - 18.03.2014

bump


Re: AttachObject [HELP] - Matess - 18.03.2014

First at all:
HTML Code:
SetPlayerHoldingObject
Warning: This function was removed in SA-MP 0.3c. check SetPlayerAttachedObject
then

pawn Code:
stock Briefcase(playerid, index, modelid, bone,  Float:OffsetX, Float:OffsetY, Float:OffsetZ, Float:rX, Float:rY, Float:rZ)
{
if(PlayerLogged[playerid] == 0) return 1;
if(GetMoney(playerid) > 10000);
SetPlayerAttachedObject(playerid, index, modelid, bone,  Float:OffsetX, Float:OffsetY, Float:OffsetZ, Float:rX, Float:rY, Float:rZ);
if(GetMoney(playerid) < 10000);
RemovePlayerAttachedObject(playerid, index);
return 1;
}

//somewhere
Briefcase(playerid, 3, 1210, 6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);//6 is right hand



Re: AttachObject [HELP] - MP2 - 18.03.2014

INDENT.


Re: AttachObject [HELP] - LazyGamer99 - 19.03.2014

Thanks!