[Ayuda] Tazer
#1

Hola que tal este es mi primer tema y tengo un problema con el tazer en el GM de zenon city lo que pasa es que pongo el comando /ta y me dice has cargado tu tazer y me saca la Sd pistol todo bien ahi pero cuando tengo cargado el tazer puedo cambiar a cualquier arma y tazeo con cualquier arma incluso con sniper desde lejos se imaginan ? xD

me gustaria que me ayudaran a que cuando ponga /ta solo me deje la Sd pistol y las otras armas se bloqueen

aca les dejo el comando /ta

pawn Cуdigo:
Quote:

CMD:ta(playerid, params[])
{
if(IsACop(playerid))
{
new string[128];
if(pTazer[playerid] == 0)
{
pTazerReplace[playerid] = Info[playerid][pWeapons][2];
if(Info[playerid][pWeapons][2] != 0) RemovePlayerWeapon(playerid, Info[playerid][pWeapons][2]);
format(string, sizeof(string), "* %s carga su tazer.", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
GivePlayerValidWeapon(playerid, 23);
pTazer[playerid] = 1;
}
else
{
RemovePlayerWeapon(playerid, 23);
GivePlayerValidWeapon(playerid, pTazerReplace[playerid]);
format(string, sizeof(string), "* %s apaga y guarda su tazer.", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
pTazer[playerid] = 0;
}
}

porfavor ayuda es el unico bug q me falta por arreglar se los agradeceria mucho
Reply
#2

Hmmm.. por lo que veo el cуdigo del GM es mucho mбs que unos simple "GivePlayerWeapon" o "ResetPlayerWeapons", por que asi a primera vista veo que tienen funciones pre-definidas como de un anticheat.

Te recomiendo que postees algunas de esas funciones o que hagas un /tazer + ID..

Saludos.
Reply
#3

Pues eso que puse es el comando original no le eh editado nada como soy nuevo en esto de scriptear pues es complicado para mi y eso de las funciones que pedis me podes explicar mejor ? lo busque en el GM y solo tengo esto

Quote:

function TazerTimer(playerid)
{
if (TazerTimeout[playerid] > 0)
{
new string[128];
format(string,sizeof(string),"~n~~n~~n~~n~~n~~n~~n ~~n~~r~Recargando Tazer... ~w~%d", TazerTimeout[playerid]);
GameTextForPlayer(playerid, string,1500, 3);
TazerTimeout[playerid] -= 1;
SetTimerEx("TazerTimer",1000,false,"d",playerid);
}
return 1;
}

y lo del anticheat es esto lo unico que hay en el GM


Quote:

new WeaponNames[47][] = // As below
{
"puсo","brass knuckles","golf club","nitestick","knife","baseball bat","shovel","palo de billar","katana","chainsaw","purple dildo","small white vibrator","large white vibrator","silver vibrator",
"bouquet of flowers","cane","grenade","tear gas grenade","molotov cocktail","jetpack"," "," ","Colt .45","silenced Colt .45","Desert Eagle","12-gauge shotgun","sawn-off shotgun","SPAS-12",
"Micro Uzi","MP5","AK-47","M4A1","TEC-9","rifle","sniper rifle","rocket launcher","heatseeker","flamethrower","minigun","s atchel charge","detonator","spray can","fire extinguisher",
"camera","nightvision goggles", "thermal goggles","parachute"
};
new HasArmor [MAX_PLAYERS];
new Float:ScriptArmor [MAX_PLAYERS];
function SetHP(playerid, Float:hp)
{
Info[playerid][pHealth] =hp;
SetPlayerHealth(playerid, hp);
return 1;
}

function GiveArmorToPlayer(playerid, Float:armour)
{
SetPlayerArmour(playerid, Float:armour);
HasArmor[playerid] = 1;
ScriptArmor[playerid] = armour;
return 1;
}
timer Anticheat[1000]()
{
foreach(Player, i)
{
if(IsPlayerConnected(i)){
new Float:health, Float:armor;
GetPlayerHealth(i, health);
if(health > Info[i][pHealth]){
SetPlayerHealth(i, Info[i][pHealth]);
}
GetPlayerArmour(i, armor);
if(armor > ScriptArmor[i]){
GiveArmorToPlayer(i, ScriptArmor[i]);
}
}
}
return 1;
}

o me podras ayudar a hacer un nuevo comando ? porfavor
Reply
#4

pawn Код:
/*
    CREDITOS: OTACON
*/

#define SACAR_TAZER (5000)
new AmmoTazer[MAX_PLAYERS];
new bool:ActivarTazer[MAX_PLAYERS]=false;
new bool:PlayerTazeado[MAX_PLAYERS]=false;
new TerminarTazeado[MAX_PLAYERS];

CMD:ta(playerid, params[])
{
    new string[128];
    AmmoTazer[playerid] = GetPlayerAmmo(playerid);
    switch(GetPlayerWeapon(playerid)) {
        case 22: { //9mm
            GivePlayerWeapon(playerid, 23, AmmoTazer[playerid]);
            AmmoTazer[playerid] = true;
            format(string, sizeof(string), "* %s carga su tazer.", GetPlayerNameEx(playerid));
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
        }
        case 23: { //Silenced 9mm
            GivePlayerWeapon(playerid, 22, AmmoTazer[playerid]);
            AmmoTazer[playerid] = false;
            format(string, sizeof(string), "* %s apaga su tazer.", GetPlayerNameEx(playerid));
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
        }
    }
    return 1;
}

public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    if(issuerid != INVALID_PLAYER_ID) {
        if(AmmoTazer[issuerid] == true && GetPlayerWeapon(issuerid) == 23 && PlayerTazeado[playerid] == false) {
            TogglePlayerControllable(playerid, false);
            PlayerTazeado[playerid] = true;
            TerminarTazeado[playerid]=SetTimerEx("TocarTazer", SACAR_TAZER, false, "i", playerid);
            new string[128];
            format(string, sizeof(string), "Tazeado %i Milisegundos.", SACAR_TAZER);
            GameTextForPlayer(playerid, string, 3000, 1);
        }
    }
    return 1;
}

forward TocarTazer(playerid);
public TocarTazer(playerid) {
    TogglePlayerControllable(playerid, true);
    PlayerTazeado[playerid] = false;
    GameTextForPlayer(playerid, "Tazer Quitado.", 3000, 1);
    KillTimer(TerminarTazeado[playerid]);
    return 1;
}
/*
    CREDITOS: OTACON
*/
Reply
#5

bytytus lo que me diste me compilo pero al poner /ta no hace nada porfavor ayuda
Reply
#6

Quote:
Originally Posted by naredin
Посмотреть сообщение
bytytus lo que me diste me compilo pero al poner /ta no hace nada porfavor ayuda
Debes Tener una 9mm para ke funcione el comando.
usa este : http://forum.sa-mp.com/showthread.ph...93#post2411193
Reply
#7

puse eso como me dijiste y me baneo el sv mira

http://i.imgur.com/cntqn7T.png
Reply
#8

Quote:
Originally Posted by naredin
Посмотреть сообщение
puse eso como me dijiste y me baneo el sv mira

http://i.imgur.com/cntqn7T.png
xDD. eso es razon de tu anti cheats, tienes Prohibida la Silenced 9mm en tu server.
configura el anticheat.
Reply
#9

Quote:
Originally Posted by bytytus
Посмотреть сообщение
xDD. eso es razon de tu anti cheats, tienes Prohibida la Silenced 9mm en tu server.
configura el anticheat.


Quite la colt 45 y la silenciada del anticheat pero aun me sigue baneando pero bueno gracias por todo lo dejare asi aver q pasa Gracias por todo ya pueden cerrar el tema
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)