06.05.2012, 16:03
(
Последний раз редактировалось zbt; 20.07.2012 в 20:06.
)
Fiz um aqui, nгo testei.
pawn Код:
#include a_samp
#include zcmd
new bool:Chuck[MAX_PLAYERS], bool:Evento[MAX_PLAYERS], players;
CMD:entrarevento(playerid) {
new s[128], n[24];
if(Evento[playerid])
return false;
if(players == 0) {
players ++;
GetPlayerName(playerid, n, 24);
format(s, 128, "%s foi para o evento do Chuck Norris.! [Jogadores: %i]", n, players);
SendClientMessageToAll(-1, s);
Evento[playerid] = true;
SendClientMessage(playerid, -1, "Sу tem vocк no evento, entгo vocк й o chuck norris da vez.");
SetPlayerPos(playerid, x, y, z);//pos
Chuck[playerid] = true;
GivePlayerWeapon(playerid, weapon, ammo); //arma e municao
SetPlayerSkin(playerid, skinid); //skin
SetPlayerArmour(playerid, 100);
SetPlayerHealth(playerid, 100);
TogglePlayerControllable(playerid, true);
}
else {
players ++;
GetPlayerName(playerid, n, 24);
format(s, 128, "%s foi para o evento do Chuck Norris.! [Jogadores: %i]", n, players);
SendClientMessageToAll(-1, s);
Evento[playerid] = true;
SetPlayerPos(playerid, x, y, z);
}
return true;
}
CMD:sairevento(playerid) {
if(!Evento[playerid])
return false;
if(Chuck[playerid]) {
Chuck[playerid] = false;
for(new i; i < MAX_PLAYERS; ++i) {
if(Evento[i]) {
SendClientMessageToAll(-1, "O Chuck Norris saiu do evento.. evento encerrado.");
SpawnPlayer(i);
Evento[i] = false;
players = 0;
}
}
}
SendClientMessage(playerid, -1, "Vocк saiu do evento..");
return true;
}
public OnPlayerDisconnect(playerid) {
if(Evento[playerid])
return players --;
if(Chuck[playerid]) {
Chuck[playerid] = false;
for(new i; i < MAX_PLAYERS; ++i) {
if(Evento[i]) {
SendClientMessageToAll(-1, "O Chuck Norris saiu do servidor.. evento encerrado.");
SpawnPlayer(i);
Evento[i] = false;
players = 0;
}
}
}
return true;
}
public OnPlayerSpawn(playerid) {
if(Evento[playerid]) {
SendClientMessage(playerid, -1, "Vocк spawnou no evento Chuck norris..");
SetPlayerPos(playerid, x, y, z);
}
return true;
}
public OnPlayerDeath(playerid, killerid, reason) {
if(Chuck[playerid]) {
Chuck[killerid] = true;
Chuck[playerid] = false;
new s[128], n[24];
GetPlayerName(killerid, n, 24);
format(s, 128, "%s й o novo Chuck Norris do evento.!", n);
SendClientMessageToAll(-1, s);
GivePlayerWeapon(killerid, weapon, ammo);
SetPlayerSkin(killerid, skinid);
SetPlayerArmour(killerid, 100);
SetPlayerHealth(killerid, 100);
TogglePlayerControllable(killerid, true);
}
return true;
}