23.02.2015, 21:51
Hi guys,
i have a script, which is basically duel script. In this script two people joins the duel, and box each other. Who kills the other person, wins.
I made this, it is working without any problem (no errors) but, when i uploaded my gamemode with this thing, and joined the duel (typed /dueljoin) the server crashed and restarted.
Do you guys know, where can be the problem? Thanks.
thanks guys
i have a script, which is basically duel script. In this script two people joins the duel, and box each other. Who kills the other person, wins.
I made this, it is working without any problem (no errors) but, when i uploaded my gamemode with this thing, and joined the duel (typed /dueljoin) the server crashed and restarted.
Do you guys know, where can be the problem? Thanks.
Код:
new Dueler[2] = INVALID_PLAYER_ID; new Duelers; new DuelBegin;
Код:
public OnPlayerDeath(playerid, killerid, reason) { if(DuelBegin == 1) { if(Dueler[0] == playerid && Dueler[1] == killerid) { GivePlayerMoney(killerid, 100); SetPlayerPos(Dueler[1], 0, 0, 0); SetPlayerVirtualWorld(Dueler[1], 0); DuelBegin = 0; Dueler[0] = INVALID_PLAYER_ID; Dueler[1] = INVALID_PLAYER_ID; } else if(Dueler[1] == playerid && Dueler[0] == killerid) { GivePlayerMoney(killerid, 100); SetPlayerPos(Dueler[0], 0, 0, 0); SetPlayerVirtualWorld(Dueler[0], 0); DuelBegin = 0; Dueler[0] = INVALID_PLAYER_ID Dueler[1] = INVALID_PLAYER_ID; } } return 1; }
Код:
dcmd_dueljoin(playerid, params[]) { #pragma unused params if(GetPlayerTeam(playerid) != 0) return SendClientMessage(playerid,F_F,"You can duel just in prison mode."); if(Duelers > 1) return SendClientMessage(playerid, F_F, "Duel is already started."); SetPlayerPos(playerid, 0, 0, 0); SetPlayerVirtualWorld(playerid, 1); TogglePlayerControllable(playerid, 0); if(Dueler[0] != INVALID_PLAYER_ID) Dueler[0] = playerid; if(Dueler[1] != INVALID_PLAYER_ID) Dueler[1] = playerid; if(Dueler[0] == playerid) SendClientMessageToAll(F_F, "[ DUEL ] Player %s joined to the duel."); if(Dueler[1] == playerid) { SendClientMessageToAll(F_F, "[ DUEL ] Player %s joined to the duel, duel started."); TogglePlayerControllable(playerid, 1); TogglePlayerControllable(Dueler[0], 1); SendClientMessage(playerid, F_F, "[ DUEL ] Start!"); } return 1; }