Please help me
#1

Deafualt gamemode : South Central


Hey, IN Miner Job, I want to make player can recieved money and "Some item"
[Random amount this item]

I Can fix this ?

Reply
#2

PHP код:
new item random (5) + 2;
SendServerMessage(playerid"You have also been given %d glistening rocks."item); 
Reply
#3

Код:
enum e_InventoryItems {
	e_InventoryItem[32],
	e_InventoryModel
};

new const g_aInventoryItems[][e_InventoryItems] = {
	{"Marijuana", 1578},
	{"Cocaine", 1575},
	{"Heroin", 1577},
	{"Steroids", 1241},
	{"Marijuana Seeds", 1578},
	{"Cocaine Seeds", 1575},
	{"Heroin Opium Seeds", 1577},
	{"Golf Club", 333},
 {"Knife", 335},
	{"Shovel", 337},
	{"Katana", 339},
	{"Colt 45", 346},
	{"Desert Eagle", 348},
	{"Micro SMG", 352},
	{"Tec-9", 372},
	{"MP5", 353},
	{"Shotgun", 349},
	{"AK-47", 355},
	{"Sawnoff Shotgun", 350},
	{"Rifle", 357},
	{"Sniper", 358},
	{"Magazine", 2039},
	{"Cooked Burger", 2703},
	{"Cooked Pizza", 2702},
	{"Driving License", 1581},
	{"Weapon License", 1581},
	{"Cellphone", 330},
	{"GPS System", 18875},
	{"Spray Can", 365},
	{"Water Bottle", 2958},
	{"Soda", 1543},
    {"Fuel Can", 1650},
	{"Crowbar", 18634},
	{"Boombox", 2226},
	{"Mask", 19036},
	{"First Aid", 1580},
	{"Repair Kit", 920},
	{"NOS Canister", 1010},
	{"Frozen Pizza", 2814},
	{"Frozen Burger", 2768},
	{"Ammo Cartridge", 2358},
	{"Armored Vest", 19142},
	{"Empty Bottle", 1484},
	{"Cardboard", 928},
	{"Chicken", 2663},
	{"Portable Radio", 18868},
	{"GoldBar", 19941}
};
In Last Item, I want to Random GoldBar 0-2

How I Can fix this ?

Thank u for your answer, I AM Newbie
Reply
#4

I was just messing, but you want to look up things regarding enumerators, and random.

The Pawn Language Guide is good in these instances.
Reply
#5

PHP код:
new GoldBar Random (0)+2
SendServerMessage(playerid"You have also been given %d glistening rocks."GoldBar); 
??
Reply
#6

PHP код:
new id Inventory_Add(playerid"GoldBar"19941) = random(0) +2
SendServerMessage
(playerid"You have also been given %d glistening rocks."id Inventory_Add(playerid"GoldBar"19941)); 
Reply
#7

Don't use random 0, it will always return 2 in this scenario.

I just put +2 replicating your code submission.

PHP код:
new GoldBar Random (2);
// Inventory_Add(playerid, "GoldBar", 19941) = GoldBar; // You REALLY want to think about this line.

/* If anything it should be playerid, item, amount.

So it should be
Inventory_Add(playerid, "GoldBar", GoldBar);*/

SendServerMessage(playerid"You have also been given %d glistening rocks."GoldBar); 
If you can post the origin of the inventory include you've used.
Reply
#8

Thank a lot Sew_Sumi
I Can Write this code




When Player Goto Checkpoint (Miner JOB)

It's Goldbar Add in Inventory +1 amount

But I want to Change +1 to Random 2,3,4 amount

How I Can Fix This... (This Code +1/times for checkpoint)
PHP код:
Inventory_Add(playerid"GoldBar"19941); 
#sorry I come From thailand, I am stupid for english

Thanks ..
Reply
#9

put up the declaration of Inventory_Add for me.

The public line in the include.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)