06.03.2015, 14:24
(
Последний раз редактировалось _GHT_MarK445; 06.03.2015 в 15:16.
)
Thx it worked.
But i added if, the player is already in the duel, he wont be enable to join again.
But, even if the player is not in the duel, it writes him message, that he is.. thx.
But i added if, the player is already in the duel, he wont be enable to join again.
But, even if the player is not in the duel, it writes him message, that he is.. thx.
Код:
dcmd_dueljoin(playerid, params[]) { #pragma unused params if(Dueler[0] == playerid) return SendClientMessage(playerid, F_SEDA, "[ CHYBA ] Uћ si v dueli."); else if(Dueler[1] == playerid) return SendClientMessage(playerid, F_SEDA, "[ CHYBA ] Uћ si v dueli."); if(Duelers > 1) return SendClientMessage(playerid, F_SEDA, "[ CHYBA ] Duel je uћ plnэ."); SetPlayerHealth(playerid, 100); SetPlayerArmour(playerid, 0); SetPlayerVirtualWorld(playerid, 1); TogglePlayerControllable(playerid, 0); if(Dueler[0] == INVALID_PLAYER_ID) Dueler[0] = playerid; else if(Dueler[1] == INVALID_PLAYER_ID) Dueler[1] = playerid; if(Dueler[0] == playerid) { SetPlayerPos(playerid, 1869.6478,-1748.4121,5206.0859); new string[128]; format(string, sizeof(string), "[ DUEL ] Hrбč %s sa pripojil do duelu, napнљ /dueljoin pre pripojenie k nemu..",GetName(playerid)); SendClientMessageToAll(F_JAILBREAKOVA, string); } else if(Dueler[1] == playerid) { SetPlayerPos(playerid, 1874.0762,-1744.3434,5206.0859); new string[128]; format(string, sizeof(string), "[ DUEL ] Hrбč %s sa pripojil do duelu, duel sa začal.",GetName(playerid)); SendClientMessageToAll(F_JAILBREAKOVA, string); TogglePlayerControllable(playerid, 1); TogglePlayerControllable(Dueler[0], 1); GameTextForPlayer(playerid, "duel sa zacal, do seba!", 500, 1); } return 1; }