married couples ? lol..
#8

Quote:
Originally Posted by Conroy
Посмотреть сообщение
If you want it to be random:

pawn Код:
new MarriedCouple[MAX_PLAYERS];

//OnPlayerConnect
MarriedCouple[playerid] = -1;
for(new i; i <= MAX_PLAYERS; i++)
{
    if(IsPlayerConected(i) && i != playerid && MarriedCouple[i] == -1) {
        MarriedCouple[playerid] = i;
        MarriedCouple[i] = playerid;
        new pname[MAX_PLAYER_NAME], iname[MAX_PLAYER_NAME], pmessage[128], imessage[128];
        GetPlayerName(playerid, pname, sizeof(pname));
        GetPlayerName(i, iname, sizeof(iname));
        format(imessage, sizeof(imessage), "%s is your married partner.", pname);
        format(pmessage, sizeof(pmessage), "%s is your married partner.", iname);
        SendClientMessage(i, COLOR_GREEN, imessage);
        SendClientMessage(playerid, COLOR_GREEN, pmessage);
        break;
    }
}

if(MarriedCouple[playerid] == -1) SendClientMessage(playerid, COLOR_RED, "There is currently no other single people online.");
That works fine.But how to make a function that would check the distance of partner 1 and distance of partner 2? like this ?
pawn Код:
public Distance(partner1,partner2)
{
    if(MarriedCouple[partner1] != -1 && MarriedCouple[partner1] != -1)
    {
        if(GetPlayerDistance(partner1,partner2) >= 10)
                 {
                      MarriedCouple[partner1] = -1 ;// to break them up .. lol..they have to stay together! for ever!!
                      MarriedCouple[partner2] != -1 ;  
                 }
    }
}
And i use that as a timer ... you know ...under ongamemode ..
Reply


Messages In This Thread
married couples ? lol.. - by Rocky Balboa - 27.09.2010, 20:56
Re: married couples ? lol.. - by Rocky Balboa - 27.09.2010, 20:58
Re: married couples ? lol.. - by Conroy - 27.09.2010, 21:05
Re: married couples ? lol.. - by Rocky Balboa - 27.09.2010, 21:06
Re: married couples ? lol.. - by Retardedwolf - 27.09.2010, 21:27
Re: married couples ? lol.. - by Conroy - 27.09.2010, 21:35
Re: married couples ? lol.. - by [HiC]TheKiller - 27.09.2010, 22:16
Re: married couples ? lol.. - by Rocky Balboa - 28.09.2010, 01:29
Re: married couples ? lol.. - by Rocky Balboa - 28.09.2010, 01:32
Re: married couples ? lol.. - by Steven82 - 28.09.2010, 03:07

Forum Jump:


Users browsing this thread: 1 Guest(s)