Jump to content
  • 0

Raza


Gigel92abaz

Question

Problema intalnita (descriere): Cum as putea adauga pe o raza cand iese cineva de pe server x has left the server(crash) arata la tot serverul...
Ero(area / rile) / warning-(ul / urile): Nu am
Liniile de cod / sursa / script-ul(obligatoriu):   

 new
        szString[64],
        playerName[MAX_PLAYER_NAME];

    GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);

    new szDisconnectReason[3][] =
    {
        "Timeout/Crash",
        "Quit",
        "Kick/Ban"
    };

    format(szString, sizeof szString, "%s left the server (%s).", playerName, szDisconnectReason[reason]);

    SendClientMessageToAll(0xC4C4C4FF, szString);
     }
    return 1;
}


Imagini / Video (optional):
Ati incercat sa rezolvati singur?: Da...

Link to comment
Share on other sites

13 answers to this question

Recommended Posts

  • 0
  • 0

Trebuie sa mergi prin toti jucatorii online si sa vezi daca sunt in raza jucatorului care iese de pe server.

​Mai mult de atat nu avem ce sa-ti explicam, mura-n gura nu se da .

Te folosesti de ProxDetector si IsPlayerInRangeOfPoint .

Link to comment
Share on other sites

  • 0

Foloseste functia asta, tutorial de folosire nu primesti :)).

 

stock SendPlayerRangeMessage( playerid, Float: f_Range, szMessage[ ] ){
    new Float: f_pPos[ 3 ];
    GetPlayerPos( playerid, f_pPos[ 0 ], f_pPos[ 1 ], f_pPos[ 2 ] );
    for( new i = 0; i < MAX_PLAYERS; i++ ){
        if( !IsPlayerConnected( i ) ) continue;
        if( !IsPlayerInRangeOfPoint( i, f_Range, f_pPos[ 0 ], f_pPos[ 1 ], f_pPos[ 2 ] ) ) continue;
        SendClientMessage( i, -1, szMessage );
    }
    return 1;
}
Edited by eXorcism

I'm back bitches.

Link to comment
Share on other sites

  • 0

Cauti asa ceva?

new
        szString[64],
        playerName[MAX_PLAYER_NAME],
		Float:x, Float:y, Float:z;

    GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
    GetPlayerPos(playerid, x, y, z);

    new szDisconnectReason[3][] =
    {
        "Timeout/Crash",
        "Quit",
        "Kick/Ban"
    };
	
    format(szString, sizeof szString, "%s left the server (%s).", playerName, szDisconnectReason[reason]);
	
	if(IsPlayerInRangeOfPoint(playerid, 7.0, x, y, z)) //7.0 e distanta, modifica daca vrei
    {	
		SendClientMessage(0xC4C4C4FF, szString);
    }

 

Link to comment
Share on other sites

  • 0

Incearca asa :

 

    new wakaname[25];
	new string2[182];
   
   
   GetPlayerName(playerid,wakaname,25);
	switch(reason)
    {
        case 0: format(string2,sizeof(string2),"%s exited the game (Crash).",wakaname);
        case 1: format(string2,sizeof(string2),"%s exited the game (/q).",wakaname);
        case 2: format(string2,sizeof(string2),"%s exited the game (Kicked/Banned).",wakaname);
    }
    ProxDetector(20.0, playerid, string2, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);

 

Link to comment
Share on other sites

  • 0
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.