[Ajuda] Comando /Pregos
#1

Oi a todos, gostava de saber porque que neste comando os Pregos nгo furam peneus dos carros:

pawn Код:
CMD:createspike(playerid, params[])
{
    new string[128], Float:Pos[4];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(!IsACop(playerid) && !IsFBI(playerid) && !IsARES(playerid) && !IsAGov(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not a LEO.");
    if(!PlayerInfo[playerid][pFacDuty]) return SendClientMessage(playerid, COLOR_GREY, "You are not on duty.");
    if(PlayerInfo[playerid][pFacRank] < 4) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command. (Rank 4+)");
    GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
    GetPlayerFacingAngle(playerid,Pos[3]);
    CreateStrip(x, y, z, angle);
    format(string, sizeof(string), "BCPD: %s has created a spike strip.", RPN(playerid));
    SendCopMessage(COLOR_BLUE, string);
    ApplyAnimation(playerid, "BOMBER","BOM_Plant_Loop",4.0,0,0,0,0,0); // Plant bomb
    return 1;
}

CMD:removespike(playerid, params[])
{
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(!IsACop(playerid) && !IsFBI(playerid) && !IsARES(playerid) && !IsAGov(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not a LEO.");
    if(PlayerInfo[playerid][pFacRank] < 4) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command. (Rank 4+)");
    DeleteClosestStrip(playerid);
    return 1;
}
e este codigo que arranjei, dб para furar peneus mas nao se adapta ao meu game mode :S vejam la o codigo:

pawn Код:
if(strcmp(cmd, "/deployspikes", true) == 0)
    {
        if(!IsACop(playerid) && !IsANG(playerid))
        {
            return SendClientMessage(playerid,COLOR_GREY,"You are not a Cop / FBI / SAST / NG.");
        }
        if(PlayerInfo[playerid][pMember] == 1)
        {
            if(PlayerInfo[playerid][pRank] < 4)
            {
                return SendClientMessage(playerid,COLOR_GREY,"Your rank is too low to be deploying spike strips.");
            }
        }
        else
        {
            if(PlayerInfo[playerid][pRank] < 5)
            {
                return SendClientMessage(playerid,COLOR_GREY,"   Your rank is too low to be removing spike strips !");
            }
        }
        if(IsPlayerInAnyVehicle(playerid))
        {
            return SendClientMessage(playerid,COLOR_GREY,"   You cannot place a spike strip while inside a vehicle !");
        }
        new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
        GetPlayerPos(playerid,plocx,plocy,plocz);
        GetPlayerFacingAngle(playerid,ploca);
        new location[MAX_ZONE_NAME];
        GetPlayer2DZone(playerid, location, MAX_ZONE_NAME);
        new Float:x, Float:y, Float:z, Float:angle;
        GetPlayerFacingAngle(playerid, angle);
        GetPlayerPos(playerid, x, y, z);
        CreateStrip(x, y, z, angle);
        format(string, sizeof(string), "HQ: %s %s has placed a spike strip at %s", GetPlayerRank(playerid),PlayerName(playerid), location);
        SendRadioMessage(1, TEAM_BLUE_COLOR, string);
        SendRadioMessage(2, TEAM_BLUE_COLOR, string);
        SendRadioMessage(3, TEAM_BLUE_COLOR, string);
        SendRadioMessage(5, TEAM_BLUE_COLOR, string);
        ApplyAnimation(playerid, "BOMBER","BOM_Plant_Loop",4.0,0,0,0,0,0); // Plant bomb
        /*GetPlayerFacingAngle(playerid,ploca);
        CreateStrip(plocx,plocy,plocz,ploca);*/

        return 1;
    }
    if(strcmp(cmd, "/deletespike", true) == 0)
    {
        if(!IsACop(playerid) && !IsANG(playerid))
        {
            return SendClientMessage(playerid,COLOR_GREY,"   You are not a Cop / FBI / SAST / NG !");
        }
        if(PlayerInfo[playerid][pMember] == 1)
        {
            if(PlayerInfo[playerid][pRank] < 4)
            {
                return SendClientMessage(playerid,COLOR_GREY,"   Your rank is too low to be removing spike strips !");
            }
        }
        else
        {
            if(PlayerInfo[playerid][pRank] < 5)
            {
                return SendClientMessage(playerid,COLOR_GREY,"   Your rank is too low to be removing spike strips !");
            }
        }
        DeleteClosestStrip(playerid);
        return 1;
    }
eu queria que o meu codigo que й o primeiro, desse para furar peneus dos veiculos :S alguem me ajuda ? dou rep+
Reply
#2

#UPP (Tуpico ficando esquecido)
Reply
#3

Ficarб por sua conta as verificaзхes.

pawn Код:
CMD:pregos(playerid, params[]){
   
    #pragma unused params
    new Float:Pregos[4], nome[MAX_PLAYER_NAME];
    GetPlayerName(playerid, nome, sizeof(nome));
    CreateStrip(Pregos[0], Pregos[1], Pregos[2], Pregos[3]);
    return 1;
}
Reply
#4

Ficaria mais fбcil vocк criar um, ou baixar um FS e adptar.

Link
Reply
#5

Quote:
Originally Posted by DannielCooper
Посмотреть сообщение
Ficarб por sua conta as verificaзхes.

pawn Код:
CMD:pregos(playerid, params[]){
   
    #pragma unused params
    new Float:Pregos[4], nome[MAX_PLAYER_NAME];
    GetPlayerName(playerid, nome, sizeof(nome));
    CreateStrip(x, y, z, angle);
    return 1;
}
Nгo consigo criar :S da-me muitos erros :S nгo а maneira de consertar o meu codigo?

pawn Код:
CMD:createspike(playerid, params[])
{
    new string[128], Float:Pos[4];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(!IsACop(playerid) && !IsFBI(playerid) && !IsARES(playerid) && !IsAGov(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not a LEO.");
    if(!PlayerInfo[playerid][pFacDuty]) return SendClientMessage(playerid, COLOR_GREY, "You are not on duty.");
    if(PlayerInfo[playerid][pFacRank] < 4) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command. (Rank 4+)");
    GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
    GetPlayerFacingAngle(playerid,Pos[3]);
    CreateStrip(Pos[0], Pos[1], Pos[2],Pos[3]);
    format(string, sizeof(string), "BCPD: %s has created a spike strip.", RPN(playerid));
    SendCopMessage(COLOR_BLUE, string);
    return 1;
}
Reply
#6

pawn Код:
CMD:createspike(playerid, params[])
{
    new string[128], Float:Pos[4];
    if(!IsPlayerLoggedIn(playerid))
        return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(!IsACop(playerid) && !IsFBI(playerid) && !IsARES(playerid) && !IsAGov(playerid))
        return SendClientMessage(playerid, COLOR_GREY, "You are not a LEO.");
    if(!PlayerInfo[playerid][pFacDuty])
        return SendClientMessage(playerid, COLOR_GREY, "You are not on duty.");
    if(PlayerInfo[playerid][pFacRank] < 4)
        return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command. (Rank 4+)");
    GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
    GetPlayerFacingAngle(playerid,Pos[3]);
    CreateStrip(Pos[0], Pos[1], Pos[2], Pos[3]);
    format(string, sizeof(string), "BCPD: %s has created a spike strip.", RPN(playerid));
    SendCopMessage(COLOR_BLUE, string);
    ApplyAnimation(playerid, "BOMBER","BOM_Plant_Loop",4.0,0,0,0,0,0); // Plant bomb
    return 1;
}
e posta os erros.
Reply
#7

Quote:
Originally Posted by PT
Посмотреть сообщение
pawn Код:
CMD:createspike(playerid, params[])
{
    new string[128], Float:Pos[4];
    if(!IsPlayerLoggedIn(playerid))
        return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(!IsACop(playerid) && !IsFBI(playerid) && !IsARES(playerid) && !IsAGov(playerid))
        return SendClientMessage(playerid, COLOR_GREY, "You are not a LEO.");
    if(!PlayerInfo[playerid][pFacDuty])
        return SendClientMessage(playerid, COLOR_GREY, "You are not on duty.");
    if(PlayerInfo[playerid][pFacRank] < 4)
        return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command. (Rank 4+)");
    GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
    GetPlayerFacingAngle(playerid,Pos[3]);
    CreateStrip(Pos[0], Pos[1], Pos[2], Pos[3]);
    format(string, sizeof(string), "BCPD: %s has created a spike strip.", RPN(playerid));
    SendCopMessage(COLOR_BLUE, string);
    ApplyAnimation(playerid, "BOMBER","BOM_Plant_Loop",4.0,0,0,0,0,0); // Plant bomb
    return 1;
}
e posta os erros.
Nгo deu erro, mas passo com o carro em cima dos pregos e os peneus nгo furam :S
Reply
#8

O objeto em si nгo fura, vocк precisa verificar se o jogador estб em cima dele. (Se este й o seu problema...)
Reply
#9

hummm entao nгo tenho de alterar o comando mas sim fazer um codigo para ver se o player passou por cima do objeto ..... eu tenho um gamemode que saquei para retirar alguns comandos uteis, e esse gamemode tem esse comando, o codigo deve tar pelo gamemode, nгo sabe dizer o id do objeto para que o possa encontrar?
Reply
#10

#RESOLVIDO jб consegui obrigado a todos pela ajuda....
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)