Jump to content
  • 0

group cash


powkda

Question


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  89
  • Reputation:   1
  • Joined:  11/11/17
  • Last Seen:  

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.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2341
  • Joined:  10/28/11
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  89
  • Reputation:   1
  • Joined:  11/11/17
  • Last Seen:  

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.

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2341
  • Joined:  10/28/11
  • Last Seen:  

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;

 

Link to comment
Share on other sites

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.

×
×
  • Create New...