Есть Дуэль системы .. Из-за некоторых людей хотят одного Дуэль системе, я пост здесь мой проект, который был сотрудничал моим другом JONA
Код: Из-за кода мало, просто изменить здесь вниз
Code
//-> Go To X1 <-// //SetPlayerPos -> Go To You Arena //SetPlayerArmor -> Give Armour //SetPlayerHealth -> Give Health // Or Others
Замечания: PID = Игрок 2 | PlayerID = Игрок 1 Вот код:
Code
#include <a_samp> #define DIALOG_DUEL 24245 new bool:InvitedDuel[MAX_PLAYERS]; new IdDuel[MAX_PLAYERS]; new bool:UsingArena; new Counting = 5; new CountDueling[5][5] ={"~r~1","~b~2","~p~3","~y~4","~g~5"}; forward ExecuteCount(playerid,pid); public ExecuteCount(playerid,pid) { if (Counting > 0) { GameTextForPlayer(playerid,CountDueling[Counting-1], 2500, 3); GameTextForPlayer(pid,CountDueling[Counting-1], 1000, 3); Counting--; SetTimerEx("GoDuel",1000,false,"ii",playerid,pid); } else { GameTextForPlayer(playerid,"~>~~g~Go~w~Go~r~Go~b~Go~<~", 2500, 3); GameTextForPlayer(pid,"~>~~g~Go~w~Go~r~Go~b~Go~<~", 2500, 3); Counting = 5; TogglePlayerControllable(playerid,true); TogglePlayerControllable(pid,true); } return 1; }
public OnPlayerCommandText(playerid, cmdtext[]) { new cmd[128]; new idx; new id; cmd = otherplayerids(cmdtext, idx); if(!strcmp("/duel", cmd, true)) { new tmp[128]; new string[128]; tmp = otherplayerids(cmdtext, idx); id = strval(tmp); if(InvitedDuel[playerid] == true) return SendClientMessage(playerid,0xF41917AA,"»»[DUEL]«« : Have you invited someone, wait Expire Invitation"); if(UsingArena == true) return SendClientMessage(playerid,0xF41917AA,"»»[DUEL]«« : At the time the Arena is Being Used"); if(!strlen(tmp)) return SendClientMessage(playerid,0xF41917AA,"»»[DUEL]«« : You must enter the ID of the player following the Way (/duel [playerid])"); if(id == playerid) return SendClientMessage(playerid,0xF41917AA,"»»[DUEL]«« : You can not invite the Self"); if(InvitedDuel[id] == true) return SendClientMessage(playerid,0xF41917AA,"»»[DUEL]«« : Currently the player is in a Duel, wait.."); new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); format(string, sizeof(string), "»»[DUEL]«« : %s This inviting you to a \n Duel Runing (Press Accept to Accept Duel)",name); ShowPlayerDialog(id,DIALOG_DUEL,DIALOG_STYLE_MSGBOX,"»»[DUEL]«« :",string,"Accept", "No"); GameTextForPlayer(id,"~r~DUE~w~LO !", 2500, 3); InvitedDuel[id] = true; IdDuel[id] = playerid; SetTimerEx("ExpireDuel",15000,false,"ii",id,playerid); return 1; } return 0; }
forward GoDuel(playerid,pid); public GoDuel(playerid,pid) { //-> Go To X1 <-// //SetPlayerPos //SetPlayerArmor //SetPlayerHealth