CMD:dueljoin(playerid, params[]) { #pragma unused params if(Duelers > 1) return SendClientMessage(playerid, COLOR_GREY, "[ CHYBA ] Duel is already full."); 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 ] Player %s joined the duel, type /dueljoin to join the duel and fight with him!",GetName(playerid)); SendClientMessageToAll(COLOR_RED, string); } if(Dueler[1] == playerid) { SetPlayerPos(playerid, 1874.0762,-1744.3434,5206.0859); new string[128]; format(string, sizeof(string), "[ DUEL ] Player %s joined the duel, duel has started!",GetName(playerid)); SendClientMessageToAll(COLOR_RED, string); TogglePlayerControllable(playerid, 1); TogglePlayerControllable(Dueler[0], 1); GameTextForPlayer(playerid, "Duel started!", 500, 1); } return 1; }
else if(Dueler[1] == playerid)
{
SetPlayerPos(playerid, 1874.0762,-1744.3434,5206.0859);
new string[128];
format(string, sizeof(string), "[ DUEL ] Player %s joined the duel, duel has started!",GetName(playerid));
SendClientMessageToAll(COLOR_RED, string);
TogglePlayerControllable(playerid, 1);
TogglePlayerControllable(Dueler[0], 1);
GameTextForPlayer(playerid, "Duel started!", 500, 1);
}
Could you please explain me, what did it changed? I mean, when i want to change something, i also want to know why, and what was changed. Thanks.
|
if(Dueler[1] == playerid)
else if(Dueler[1] == playerid)
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; }
I repped you, can you guys please help me, with problem explained above?
|
public OnPlayerDeath(playerid, killerid, reason) { if(Dueler[0] == playerid) Dueler[0] = INVALID_PLAYER_ID; else if(Dueler[1] == playerid) Dueler[1] = INVALID_PLAYER_ID; return 1; }