[Help]making a pickup with commands
#1

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

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");
}
Reply
#3

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

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

i know the function but where to put it?
Reply
#6

forward OnPlayerPickUpPickup(playerid,pickupid);
Reply
#7

thx very much for ur help guys
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)