27.09.2010, 21:35
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.");