Send Message to Only Family Member?? - 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)
+--- Thread: Send Message to Only Family Member?? (
/showthread.php?tid=361782)
Send Message to Only Family Member?? -
ArmandoRamiraz - 22.07.2012
I was wondering if anyone could help me out with making the points only be send to family members. For example when their paychecks come, it shows all the points that are available to capture, but everyone can see it. I want to make it to where only family members can. Any help??
Heres the code:
Код:
// Paycheck
if(tmin == 0 && tsec <= 4 && PayChecks == 0)
{
SetWorldTime(thour);
Paycheck();
// Points
for(new idx = 0; idx<MAX_POINTS; idx++)
{
PointBC[idx] = 0;
}
for(new idx = 0; idx < MAX_POINTS; idx++)
{
if(PointInfo[idx][pTime]) PointInfo[idx][pTime] --;
if(!PointInfo[idx][pTime] && !PointBC[idx])
{
PointInfo[idx][pOwner] = 0;
PointInfo[idx][pProfit] = 0;
format(string, sizeof(string), "The %s is available to be captured.", PointInfo[idx][pName]);
SendClientMessageToAll(COLOR_YELLOW, string);
DestroyDynamicPickup(PointInfo[idx][pPickup]);
DestroyDynamic3DTextLabel(PointInfo[idx][pText]);
PointInfo[idx][pPickup] = CreateDynamicPickup(1239, 1, PointInfo[idx][pX], PointInfo[idx][pY], PointInfo[idx][pZ]);
PointInfo[idx][pText] = CreateDynamic3DTextLabel("Point\n/capture", COLOR_WHITE, PointInfo[idx][pX], PointInfo[idx][pY], PointInfo[idx][pZ]+0.3, 15);
}
}
}
return 1;
}
Re: Send Message to Only Family Member?? -
Kindred - 22.07.2012
You should make a timer that would loop through every player, and then check if the player's family variable is a certain value.
Lets say the family variable is set to the family id, and the family id cannot be 0, you could do this:
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(pInfo[i][Family] >= 1)
{
//Show points here
}
}
Re: Send Message to Only Family Member?? -
ArmandoRamiraz - 22.07.2012
Quote:
Originally Posted by Kindred
You should make a timer that would loop through every player, and then check if the player's family variable is a certain value.
Lets say the family variable is set to the family id, and the family id cannot be 0, you could do this:
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++) { if(pInfo[i][Family] >= 1) { //Show points here } }
|
Thanks, thats a great idea. I'll try it.
Re: Send Message to Only Family Member?? -
ArmandoRamiraz - 22.07.2012
Sorry for double post but I cant seem to figure this out. Everytime I put the code in I get 26 errors and they are all undefined symbols. Any ideas?
Re: Send Message to Only Family Member?? -
ReneG - 22.07.2012
You probably left out a bracket, or it is some other random scripting error.