Jump to content
  • 0

group cash


Question

Posted

I am using this item for all group members to earn cash

31002,Bônus_Eletrônico,Bônus Eletrônico,2,10000,,2500,,,,,0xFFFFFFFF,7,2,,,,,,{ addrid(2,1,getcharid(1)); set @cash, rand(1,100); set #CASHPOINTS,#CASHPOINTS+@cash; dispbottom "PowkRO: Você Ganhou "+@cash+" Rops."; },{},{}

 

I wanted it to be like this:
Who opened: chance from 1 to 100 and the amount of cash the group members won will appear.
Party members: chance to win from 1 to 50.

3 answers to this question

Recommended Posts

  • 0
Posted

try this

31002,Bônus_Eletrônico,Bônus Eletrônico,2,10000,,2500,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc("F_PartyEarnCash"); },{},{}

load this npc script

function	script	F_PartyEarnCash	{
	.@amount = rand(1, 100);
	#CASHPOINTS += .@amount; 
	dispbottom "PowkRO: Você Ganhou "+F_InsertComma(.@amount)+" Rops.";
		
	.@party_id = getcharid(1);
	if (.@party_id) {
		.@owner_aid = getcharid(3);
		.@owner_cid = getcharid(0);
		
		getpartymember .@party_id, 2;
		.@partymembercount = $@partymembercount;
		for (.@i = 0; .@i < .@partymembercount; .@i++) {
			if ($@partymemberaid[.@i] == .@owner_aid) 
				continue;
				
			if (attachrid($@partymemberaid[.@i])) {
				.@amount = rand(1, 50);
				#CASHPOINTS += .@amount; 
				dispbottom "PowkRO: Você Ganhou "+F_InsertComma(.@amount)+" Rops.";
				dispbottom "PowkRO: '"+strcharinfo(0)+"' gained "+F_InsertComma(.@amount)+" Rops.", 0x00FF00, .@owner_cid;
				detachrid;
			}
		}
	}
	return;
}

 

  • Upvote 1
  • 0
Posted
On 3/5/2022 at 9:07 AM, Emistry said:

try this

31002,Bônus_Eletrônico,Bônus Eletrônico,2,10000,,2500,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc("F_PartyEarnCash"); },{},{}

load this npc script

function	script	F_PartyEarnCash	{
	.@amount = rand(1, 100);
	#CASHPOINTS += .@amount; 
	dispbottom "PowkRO: Você Ganhou "+F_InsertComma(.@amount)+" Rops.";
		
	.@party_id = getcharid(1);
	if (.@party_id) {
		.@owner_aid = getcharid(3);
		.@owner_cid = getcharid(0);
		
		getpartymember .@party_id, 2;
		.@partymembercount = $@partymembercount;
		for (.@i = 0; .@i < .@partymembercount; .@i++) {
			if ($@partymemberaid[.@i] == .@owner_aid) 
				continue;
				
			if (attachrid($@partymemberaid[.@i])) {
				.@amount = rand(1, 50);
				#CASHPOINTS += .@amount; 
				dispbottom "PowkRO: Você Ganhou "+F_InsertComma(.@amount)+" Rops.";
				dispbottom "PowkRO: '"+strcharinfo(0)+"' gained "+F_InsertComma(.@amount)+" Rops.", 0x00FF00, .@owner_cid;
				detachrid;
			}
		}
	}
	return;
}

 

thank you very much, that's exactly what I want /lv
there's a way to check if in any member of the group at @autotrade and if you don't give the cash to that member.

  • 0
Posted
On 5/31/2022 at 7:28 PM, powkda said:

to check if in any member of the group at @autotrade and if you don't give the cash to that member.

if (checkvending(convertpcinfo($@partymemberaid[.@i], CPC_NAME)) & 2) 
	continue;

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...