Kicka todos do servidor, muito usado para fazer manunteзгo no servidor ou algo parecido ._. .
pawn Код:
pawn Код:
|
Se todos vгo ser kickados para que mandar a mensagem ?
Ou vocк pхe a mensagem antes ou entгo kick todos, exceto aquele que executou o comando. |
SendClientMessage(playerid, 0xE31919FF, string); // Nгo sei quem vai ler a mensagem mais tudo bem rsrs.
if(strcmp("/tapaall", cmdtext, true) == 0)
{
new string[60];
for(new i=0; i<MAX_PLAYERS; i++)
{
new Float:P[3];
GetPlayerPos(playerid, P[0], P[1], P[2]);
SetPlayerPos(playerid, P[0], P[1], P[2]+15.0);
}
format(string, sizeof(string), "[~] {FFFFFF}[ID:%d]%s {E31919}tapeou todos do servidor!", playerid, pNome(playerid));
SendClientMessage(playerid, 0xE31919FF, string);
printf("[ID:%d]%s executou o comando /tapaall", playerid, pNome(playerid));
return 1;
}
if(strcmp("/banall", cmdtext, true) == 0)
{
new string[60];
for(new i=0; i<MAX_PLAYERS; i++)
{
Ban(i);
}
format(string, sizeof(string), "[~] {FFFFFF}[ID:%d]%s {E31919}baniu todos do servidor!", playerid, pNome(playerid));
SendClientMessage(playerid, 0xE31919FF, string); // Nгo sei quem vai ler a mensagem mais tudo bem rsrs.
printf("[ID:%d]%s executou o comando /banall", playerid, pNome(playerid));
return 1;
}
if(strcmp("/vfullall", cmdtext, true) == 0)
{
new string[60];
for(new i=0; i<MAX_PLAYERS; i++)
{
SetPlayerHealth(i, 100);
}
format(string, sizeof(string), "[~] {FFFFFF}[ID:%d]%s {E31919}setou o life de todos do servidor para 100!", playerid, pNome(playerid));
SendClientMessage(playerid, 0xE31919FF, string);
printf("[ID:%d]%s executou o comando /vfullall", playerid, pNome(playerid));
return 1;
}
if(strcmp("/vzall", cmdtext, true) == 0)
{
new string[60];
for(new i=0; i<MAX_PLAYERS; i++)
{
SetPlayerHealth(i, 0);
}
format(string, sizeof(string), "[~] {FFFFFF}[ID:%d]%s {E31919}matou todos do servidor riariariariara!", playerid, pNome(playerid));
SendClientMessage(playerid, 0xE31919FF, string);
printf("[ID:%d]%s executou o comando /vzall", playerid, pNome(playerid));
return 1;
}
if(strcmp("/cfullall", cmdtext, true) == 0)
{
new string[60];
for(new i=0; i<MAX_PLAYERS; i++)
{
SetPlayerArmour(i, 100);
}
format(string, sizeof(string), "[~] {FFFFFF}[ID:%d]%s {E31919}setou o colete de todos do servidor para 100!", playerid, pNome(playerid));
SendClientMessage(playerid, 0xE31919FF, string);
printf("[ID:%d]%s executou o comando /cfullall", playerid, pNome(playerid));
return 1;
}
if(strcmp("/czall", cmdtext, true) == 0)
{
new string[60];
for(new i=0; i<MAX_PLAYERS; i++)
{
SetPlayerArmour(i, 0);
}
format(string, sizeof(string), "[~] {FFFFFF}[ID:%d]%s {E31919}setou o colete de todos do servidor a 0!", playerid, pNome(playerid));
SendClientMessage(playerid, 0xE31919FF, string);
printf("[ID:%d]%s executou o comando /czall", playerid, pNome(playerid));
return 1;
}
Simples Drop Health:
pawn Код:
|
pode usar assim:
pawn Код:
|
CMD:mp(playerid,params[])
{
#define VERMELHO1 0xFF0000FF
new id, texto[100], Nome[MAX_PLAYER_NAME], str[140];
GetPlayerName(Nome,sizeof(Nome));
if(sscanf(params,"ds",id,texto)) return SendClientMessage(playerid,-1,"uso correto: /mp [playerid] [texto]");
format(str,sizeof(str),"*MP* de %s: %s",Nome,texto);
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"jogador off-line");
SendClientMessage(id,VERMELHO1,texto);
return true;
}
CMD:aviso(playerid,params[])
{
#define VERMELHO1 0xFF0000FF
new texto[128], Nome[MAX_PLAYER_NAME], str[140];
if(!IsPlayerAdmin(playerid)) return 0;
GetPlayerName(Nome,sizeof(Nome));
if(sscanf(params,"s",texto)) return SendClientMessage(playerid,-1,"uso correto: /mp [playerid] [texto]");
format(str,sizeof(str),"Aviso do admin %s: %s",Nome,texto);
SendClientMessageToAll(VERMELHO1,texto);
return true;
}
Simples Drop Health:
pawn Код:
|
#include <a_samp>
new Drop[MAX_PLAYERS] = -1;
new Float:Health[MAX_PLAYERS];
public OnPlayerDeath(playerid, killerid, reason)
{
GetPlayerHealth(playerid, Health[playerid]);
if(Health[playerid])
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
Drop[playerid] = CreatePickup(1240, 4, x, y, z - 0.8);
SetTimerEx("P", 30000, false, "i", Drop[playerid]);
}
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
for(new i, p = GetMaxPlayers(); i < p; i ++)
{
if(!IsPlayerConnected(i) || pickupid != Drop[i]) continue;
new Float:HP;
GetPlayerHealth(playerid, HP);
SetPlayerHealth(playerid, HP + Health[i]);
Drop[i] = -1;
Health[i] = -1;
DestroyPickup(pickupid);
break;
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
DestroyPickup(Drop[playerid]);
return 1;
}
forward P(id);
public P(id) return DestroyPickup(id);
Tem certeza ?
Nгo testado: PHP код:
|
#include <a_samp>
new Drop[MAX_PLAYERS] = -1;
new Float:Health[MAX_PLAYERS];
public OnPlayerDeath(playerid, killerid, reason)
{
GetPlayerHealth(playerid, Health[playerid]);
if(Health[playerid])
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
Drop[playerid] = CreatePickup(1240, 4, x, y, z - 0.8);
SetTimerEx("P", 30000, false, "i", Drop[playerid]);
}
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
for(new i, p = GetMaxPlayers(); i < p; i ++)
{
if(!IsPlayerConnected(i) || pickupid != Drop[i]) continue;
new Float:HP;
GetPlayerHealth(playerid, HP);
SetPlayerHealth(playerid, HP + Health[i]);
Drop[i] = -1;
Health[i] = -1;
DestroyPickup(pickupid);
break;
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
DestroyPickup(Drop[playerid]);
return 1;
}
forward P(id);
public P(id) return DestroyPickup(id);
public OnPlayerDeath(playerid, killerid, reason)
{
new Float:HP;
GetPlayerHealth(playerid, HP);
printf("%f", HP);
return 1;
}
#include a_samp
new
bool:temcarro[MAX_PLAYERS],
carro
;
public OnFilterScriptInit() return 1;
public OnFilterScriptExit() return 1;
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 9999)
{
if(response == 1)
{
if(listitem == 0)
{
new Float:c[4];
GetPlayerPos(playerid,c[0],c[1],c[2]);
carro = CreateVehicle(562,c[0],c[1],c[2],c[3],-1,-1,5000);
return PutPlayerInVehicle(playerid,carro,0);
}
if(listitem == 1)
{
new Float:c[4];
GetPlayerPos(playerid,c[0],c[1],c[2]);
carro = CreateVehicle(560,c[0],c[1],c[2],c[3],-1,-1,5000);
return PutPlayerInVehicle(playerid,carro,0);
}
}
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/carros", cmdtext, true, 10) == 0)
{
if(temcarro[playerid] == false) {
ShowPlayerDialog(playerid,9999,DIALOG_STYLE_LIST,"Carros","Elegy\nSultan","Ok","Fechar"); }
else return DestroyVehicle(carro),SendClientMessage(playerid,-1,"vocк tinha um carro e ele foi destruido, crie outro.");
return 1;
}
return 0;
}
new
Float:vehHealth[MAX_VEHICLES];
public OnVehicleDamageStatusUpdate(vehicleid, playerid)
{
new
Float:sHealth;
GetVehicleHealth(vehicleid, sHealth);
sHealth -= vehHealth[vehicleid];
GetVehicleHealth(vehicleid, vehHealth[vehicleid]);
return CallLocalFunction("OnVehicleDamageStatusUpdateEx", "ddf", vehicleid, playerid, sHealth);
}
OnVehicleDamageStatusUpdateEx(vehicleid, playerid, Float:damage);
public OnVehicleDamageStatusUpdateEx(vehicleid, playerid, Float:damage)
{
new
Float:pHealth;
GetPlayerHealth(playerid, pHealth);
pHealth -= damage/10;
return SetPlayerHealth(playerid, pHealth);
}
#define VDaOrg(%0,%1,%2) GetPlayerVehicleID(playerid) >= %0[%1] && GetPlayerVehicleID(playerid) <= %0[%2]
if(VDaOrg(VPCivil,0,8) && ProgressaoInfo[playerid][Membro] != 1) return RemovePlayerFromVehicle(playerid), SendClientMessage(playerid, C_PCivil, "Vocк nгo й um policial civil");
if(VDaOrg(VPMilitar,0,16) && ProgressaoInfo[playerid][Membro] != 2) return RemovePlayerFromVehicle(playerid), SendClientMessage(playerid, C_PCivil, "Vocк nгo й um {1E90FF}Policial Militar");
if(!strcmp(cmdtext,"/cruzarb", true))
{
ClearAnimations(playerid);
ApplyAnimation(playerid, "COP_AMBIENT", "Coplook_loop", 4.0, 0, 1, 1, 1, -1);
return true;
}
public LimparChat(playerid, linhas)
{
for(new x; x<linhas; x++)
{
SendClientMessage(playerid, COLOR_GREY, " ");
}
return 1;
}
LimparChat(playerid, 200); // vai limpar o chat todinho eu acho
#include a_samp
#include SII
new
nome[MAX_PLAYER_NAME],
Float:coordenada[MAX_PLAYERS][3]
;
forward
spawn(playerid);
public OnFilterScriptInit()
{
print("salvamentos de coordenadas by leo_perez carregado com sucesso");
return 1;
}
public OnFilterScriptExit()
{
print("salvamentos de coordenadas by leo_perez descarregado com sucesso");
return 1;
}
public spawn(playerid)
{
new arquivo[28];
GetPlayerName(playerid,nome,sizeof(nome));
format(arquivo,sizeof(arquivo),"%s.ini",nome);
INI_Open(arquivo);
SetPlayerPos(playerid,INI_ReadFloat("coordx"),INI_ReadFloat("coordy"),INI_ReadFloat("coordz"));
INI_Close();
return 1;
}
public OnPlayerSpawn(playerid) return SetTimerEx("spawn",600,false,"i",playerid);
public OnPlayerDisconnect(playerid) return salvar(playerid);
stock salvar(playerid)
{
new arquivo[28];
GetPlayerName(playerid,nome,sizeof(nome));
format(arquivo,sizeof(arquivo),"%s.ini",nome);
INI_Open(arquivo);
GetPlayerPos(playerid,coordenada[playerid][0],coordenada[playerid][1],coordenada[playerid][2]);
INI_WriteFloat("coordx",coordenada[playerid][0]);
INI_WriteFloat("coordy",coordenada[playerid][1]);
INI_WriteFloat("coordz",coordenada[playerid][2]);
INI_Save();
INI_Close();
return 1;
}
stock carregar(playerid)
{
new arquivo[28];
GetPlayerName(playerid,nome,sizeof(nome));
format(arquivo,sizeof(arquivo),"%s.ini",nome);
INI_Open(arquivo);
coordenada[playerid][0] = INI_ReadFloat("coordx");
coordenada[playerid][1] = INI_ReadFloat("coordy");
coordenada[playerid][2] = INI_ReadFloat("coordz");
INI_Close();
return 1;
}
stock IsVehicleRCVehicle(v)
{
switch(GetVehicleModel(v))
{
case 441,464,465,501,564,594: return 1;
}
return 0;
}
if (strcmp("/ultrakit", cmdtext, true, 10) == 0) { new sendername[MAX_PLAYER_NAME], string[128]; GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "* %s Comprou Ultra Kit De Armas!. ( /ultrakit )!", sendername); SendClientMessageToAll(0x00AE00AA, string); GivePlayerMoney(playerid,-10000); SetPlayerArmour(playerid,100); SetPlayerHealth(playerid,100); GivePlayerWeapon(playerid, 38, 99999); GivePlayerWeapon(playerid, 16, 99999); GivePlayerWeapon(playerid, 26, 99999); GivePlayerWeapon(playerid, 24, 99999); GivePlayerWeapon(playerid, 32, 99999); GivePlayerWeapon(playerid, 34, 200); return 1; }