SA-MP Forums Archive
Ayuda a Crear un comando Simple - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: Ayuda a Crear un comando Simple (/showthread.php?tid=634756)



Ayuda a Crear un comando Simple - Gamerd - 25.05.2017

Hola amigos Como Creo Un Comando Simple
Que 2 Jugadores Del mismo Equipo No Se Puedan Matar Actualmente tengo que si se matan Mata al jugador que mato al otro automaticamente



Respuesta: Ayuda a Crear un comando Simple - Pavas24 - 25.05.2017

Me parece que eso no es un comando jaja, pero puedes usar esta funciуn.


Re: Ayuda a Crear un comando Simple - Toroi - 25.05.2017

https://sampwiki.blast.hk/wiki/SetPlayerTeam


Respuesta: Ayuda a Crear un comando Simple - Eistein - 25.05.2017

Eso no es un comando...

Puedes utilizar esto.

Код:
#define TEAM_1 1

public OnPlayerUpdate(playerid)
{
new equipo = GetPlayerTeam(playerid);

if(equipo == TEAM_1)
{
...
}

else if
{
...
}

}
https://sampwiki.blast.hk/wiki/SetPlayerTeam
https://sampwiki.blast.hk/wiki/GetPlayerTeam

Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
{
    new string[128], victim[MAX_PLAYER_NAME], attacker[MAX_PLAYER_NAME];
    new weaponname[24];
    GetPlayerName(playerid, attacker, sizeof (attacker));
    GetPlayerName(damagedid, victim, sizeof (victim));
 
    GetWeaponName(weaponid, weaponname, sizeof (weaponname));
    format(string, sizeof(string), "%s", amount);
    SetPlayerHealth(playerid, string);
    return 1;
}
Te quiero recordar que ese codigo ni te funcionara.. Es solo para que te des una idea de como hacerlo.