SA-MP Forums Archive
[Help]making a pickup with commands - 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]making a pickup with commands (/showthread.php?tid=123242)



[Help]making a pickup with commands - hvampire - 24.01.2010

i want to make a command /createpickup for rcon admins only , i know how to add a pickup but under this form :


CreatePickup(model,type,X,Y,Z,Virtualworld)

i want when /createpickup , pickup show in from of the admin who used the command how can i do that??


Re: [Help]making a pickup with commands - LuxurioN™ - 24.01.2010

Try this (Not Tested):

pawn Код:
if(strcmp(cmd, "/createpickup", true) == 0)
{
if(IsPlayerAdmin(playerid))
{
new tmp[256], idx;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_HERE, "USE: /pickup [id]");

new PickupID = strval(tmp);
new Float:X, Float:Y, Float:Z, Float:Ang;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
X += (3 * floatsin(-Ang, degrees));
Y += (3 * floatcos(-Ang, degrees));
return CreatePickup(PickupID, 2, X+2, Y, Z);
}
else return SendClientMessage(playerid,COLOR_HERE,"You are not is RCON Administrator");
}



Re: [Help]making a pickup with commands - hvampire - 24.01.2010

thnx very very much it is working , but i got one more question like if i made /pickup 1274 , it spawns money , but when i pick it up , i gain nothing , how can i edit the ammount??


Re: [Help]making a pickup with commands - LuxurioN™ - 24.01.2010

pawn Код:
GivePlayerMoney(playerid,...);



Re: [Help]making a pickup with commands - hvampire - 24.01.2010

i know the function but where to put it?


Re: [Help]making a pickup with commands - Babul - 24.01.2010

forward OnPlayerPickUpPickup(playerid,pickupid);



Re: [Help]making a pickup with commands - hvampire - 25.01.2010

thx very much for ur help guys