new str[256]; public OnPlayerDeath(playerid, killerid, reason) { if(Minigun[playerid] == true && Minigun[killerid] == true) { GivePlayerMoney(killerid, 5000); format(str, sizeof(str), "", playerid); format(str, sizeof(str), "You want to return to the Minigun Event?", playerid); format(str, sizeof(str), "", playerid); ShowPlayerDialog(playerid, DialogReturnToEvent, DIALOG_STYLE_MSGBOX, "Assassin's City TDM - Minigun Event", str, "Yes", "Not"); } return 1; }
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == DialogReturnToEvent) { if(response) { new rand = random(sizeof(RandomSpawnEventoMinigun)); SetPlayerPos(playerid, RandomSpawnEventoMinigun[rand][0], RandomSpawnEventoMinigun[rand][1], RandomSpawnEventoMinigun[rand][2]); SetPlayerFacingAngle(playerid, RandomSpawnEventoMinigun[rand][3]); ResetPlayerWeapons(playerid); SetPlayerHealth(playerid, 100); SetPlayerArmour(playerid, 100); GivePlayerWeapon(playerid, 38, 99999); return 1; } else { SetPlayerArmour(playerid, 0); SetPlayerHealth(playerid, 100); SpawnPlayer(playerid); } } return 1; }
new entrouevento;
if(entrouevento > 1) { //funзхes }
new morreuevento > 1)
{
ShowPlayerDialog...
morreuevento[playerid] = 1;
#include <a_samp> #include <zcmd> //------------------------------------------------------------------------------ #define COR_VERMELHO 0xFF0037FF #define COR_BRANCO 0xFFFFFFAA #define COR_AMARELO 0xFFFF00AA #define COR_VERDE 0x33AA33AA #define COR_AZUL 0x33CCFFAA #define COR_VERDE_LIMAO 0x32CD32 #define COR_CINZA_AZUL 0x456EAF67 #define COR_VERDE_MEDIO 0x9CDE7180 #define COR_LARANJA 0xFF9933AA #define COR_BRANCO 0xFFFFFFAA #define DialogEvents 1 #define DialogReturnToEvent 2 //------------------------------------------------------------------------------ new bool:Minigun[MAX_PLAYERS]; new str[256]; new EntrouEvento; //------------ As duas news que vocк disse. new MorreuEvento; //------------ As duas news que vocк disse. //------------------------------------------------------------------------------ new Float:RandomSpawnEventoMinigun[15][4] = { {2624.7727,-2192.1421,16.9531}, {2757.8376,-2231.1660,18.8828}, {2681.9607,-2217.2261,13.5469}, {2619.4939,-2249.2061,13.5469}, {2668.1934,-2240.0417,16.2088}, {2550.9419,-2243.7205,16.1853}, {2501.7581,-2243.3040,16.1853}, {2447.2952,-2210.4795,26.6328}, {2422.7998,-2261.9072,15.9666}, {2360.8689,-2284.4912,17.4219}, {2358.8044,-2326.2361,16.0291}, {2321.1487,-2300.8777,28.9710}, {2377.0098,-2237.9568,20.0520}, {2412.6504,-2271.5410,13.5469}, {2517.2971,-2218.9626,27.4229} }; //------------------------------------------------------------------------------ public OnPlayerDisconnect(playerid, reason) { if(Minigun[playerid] == true) { Minigun[playerid] = false; } return 1; } //------------------------------------------------------------------------------ public OnPlayerDeath(playerid, killerid, reason) { if(MorreuEvento > 1) //---------------------------- Aqui a outra parte que vocк disse. { GivePlayerMoney(killerid, 5000); format(str, sizeof(str), "", playerid); format(str, sizeof(str), "You want to return to the Minigun Event?", playerid); format(str, sizeof(str), "", playerid); ShowPlayerDialog(playerid, DialogReturnToEvent, DIALOG_STYLE_MSGBOX, "Assassin's City TDM - Minigun Event", str, "Yes", "Not"); } return 1; } //------------------------------------------------------------------------------ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == DialogReturnToEvent) { if(response) { new rand = random(sizeof(RandomSpawnEventoMinigun)); SetPlayerPos(playerid, RandomSpawnEventoMinigun[rand][0], RandomSpawnEventoMinigun[rand][1], RandomSpawnEventoMinigun[rand][2]); SetPlayerFacingAngle(playerid, RandomSpawnEventoMinigun[rand][3]); ResetPlayerWeapons(playerid); SetPlayerHealth(playerid, 100); SetPlayerArmour(playerid, 100); GivePlayerWeapon(playerid, 38, 99999); return 1; } else { SetPlayerArmour(playerid, 0); SetPlayerHealth(playerid, 100); SpawnPlayer(playerid); } } return 1; } //------------------------------------------------------------------------------ CMD:events(playerid, params[]) { ShowPlayerDialog(playerid, DialogEvents, DIALOG_STYLE_LIST, "Assassin's City TDM - Active Events", "Minigun Event - Use ~> /MinigunEvent", "Close", ""); return 1; } //------------------------------------------------------------------------------ CMD:minigunevent(playerid, params[]) { if(EntrouEvento > 1) //--------------------------- Aqui a outra parte que vocк disse tambйm. { new rand = random(sizeof(RandomSpawnEventoMinigun)); SetPlayerPos(playerid, RandomSpawnEventoMinigun[rand][0], RandomSpawnEventoMinigun[rand][1], RandomSpawnEventoMinigun[rand][2]); SetPlayerFacingAngle(playerid, RandomSpawnEventoMinigun[rand][3]); ResetPlayerWeapons(playerid); SetPlayerHealth(playerid, 100); SetPlayerArmour(playerid, 100); GivePlayerWeapon(playerid, 38, 99999); SendClientMessage(playerid, 0x0DFF00AA, "To exit the Minigun Event, use /exit"); } return 1; } //------------------------------------------------------------------------------ CMD:exit(playerid, params[]) { SetPlayerArmour(playerid, 0); SetPlayerHealth(playerid, 100); SpawnPlayer(playerid); return 1; } //------------------------------------------------------------------------------
public OnPlayerDeath(playerid, killerid, reason)
{
if(MorreuEvento >= 1) //---------------------------- Aqui a outra parte que vocк disse.
{
GivePlayerMoney(killerid, 5000);
format(str, sizeof(str), "", playerid);
format(str, sizeof(str), "You want to return to the Minigun Event?", playerid);
format(str, sizeof(str), "", playerid);
ShowPlayerDialog(playerid, DialogReturnToEvent, DIALOG_STYLE_MSGBOX, "Assassin's City TDM - Minigun Event", str, "Yes", "Not");
}
return 1;
}
MorreuEvento[playerid] = 1;
if(entrouevento >= 1) //---------------------------- Aqui a outra parte que vocк disse.
{
morreuevento[playerid] = 1;
}
if(morreuevento >= 1)
{
GivePlayerMoney(killerid, 5000);
format(str, sizeof(str), "", playerid);
format(str, sizeof(str), "You want to return to the Minigun Event?", playerid);
format(str, sizeof(str), "", playerid);
ShowPlayerDialog(playerid, DialogReturnToEvent, DIALOG_STYLE_MSGBOX, "Assassin's City TDM - Minigun Event", str, "Yes", "Not");
}
entrouevento[playerid] = 1;
if(MorreuEvento > 1)
//
if(MorreuEvento == 1)
ProKillerpa,
por que nгo utilizar o operador " == " ? pawn Код:
|
forward
publica
>
=
Por costume, igual Paulor sempre usava para verificar, veja
PHP код:
PHP код:
|
public OnPlayerDeath(playerid, killerid, reason) { if(EntrouEvento > 1) //------------------------------------ Aqui { MorreuEvento[playerid] = 1; //------------------------- Aqui } if(MorreuEvento > 1) //------------------------------------ Aqui { GivePlayerMoney(killerid, 5000); format(str, sizeof(str), "", playerid); format(str, sizeof(str), "You want to return to the Minigun Event?", playerid); format(str, sizeof(str), "", playerid); ShowPlayerDialog(playerid, DialogReturnToEvent, DIALOG_STYLE_MSGBOX, "Assassin's City TDM - Minigun Event", str, "Yes", "Not"); } return 1; }
CMD:minigunevent(playerid, params[]) { new rand = random(sizeof(RandomSpawnEventoMinigun)); SetPlayerPos(playerid, RandomSpawnEventoMinigun[rand][0], RandomSpawnEventoMinigun[rand][1], RandomSpawnEventoMinigun[rand][2]); SetPlayerFacingAngle(playerid, RandomSpawnEventoMinigun[rand][3]); ResetPlayerWeapons(playerid); SetPlayerHealth(playerid, 100); SetPlayerArmour(playerid, 100); GivePlayerWeapon(playerid, 38, 99999); SendClientMessage(playerid, 0x0DFF00AA, "To exit the Minigun Event, use /exit"); EntrouEvento[playerid] = 1; //------------------------------------ Aqui return 1; }
public OnPlayerDeath(playerid, killerid, reason)
{
if(EntrouEvento >= 1) //------------------------------------ Aqui
{
MorreuEvento[playerid] = 1; //------------------------- Aqui
}
if(MorreuEvento >= 1) //------------------------------------ Aqui
{
GivePlayerMoney(killerid, 5000);
format(str, sizeof(str), "", playerid);
format(str, sizeof(str), "You want to return to the Minigun Event?", playerid);
format(str, sizeof(str), "", playerid);
ShowPlayerDialog(playerid, DialogReturnToEvent, DIALOG_STYLE_MSGBOX, "Assassin's City TDM - Minigun Event", str, "Yes", "Not");
}
return 1;
}
Estб Ok, apenas faltou um Operador
PHP код:
|