[Pedido] /dararmas a todos proximos
#1

titulo ja explica tudo
aguardando...
Reply
#2

IsPlayerInRangeOfPoint
Reply
#3

Uma base.


pawn Код:
CMD:armaperto(playerid, params[])
{
    new string[62];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(GetDistanceBetweenPlayers(playerid, i) <= 30)
        {
            if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
            {
                GivePlayerWeapon(i, 24, 9999);  //eagle.
            }
        }
    }
    return 1;
}


// Stock no final do GameMode.

stock GetDistanceBetweenPlayers(playerid, playerid2) {
    new Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2;
    new Float:tmpdis;
    GetPlayerPos(playerid, x1, y1, z1);
    GetPlayerPos(playerid2, x2, y2, z2);
    tmpdis = floatsqroot(floatpower(floatabs(floatsub(x2, x1)), 2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
    return floatround(tmpdis);
}
Reply
#4

Quote:
Originally Posted by Bieeel_Cwb
Посмотреть сообщение
Uma base.


pawn Код:
CMD:armaperto(playerid, params[])
{
    new string[62];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(GetDistanceBetweenPlayers(playerid, i) <= 30)
        {
            if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
            {
                GivePlayerWeapon(i, 24, 9999);  //eagle.
            }
        }
    }
    return 1;
}


// Stock no final do GameMode.

stock GetDistanceBetweenPlayers(playerid, playerid2) {
    new Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2;
    new Float:tmpdis;
    GetPlayerPos(playerid, x1, y1, z1);
    GetPlayerPos(playerid2, x2, y2, z2);
    tmpdis = floatsqroot(floatpower(floatabs(floatsub(x2, x1)), 2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
    return floatround(tmpdis);
}
tipo essa ai msm mano mais to procurando o q o cara escolhe a arma por id
Reply
#5

-----------------------------
Reply
#6

pawn Код:
CMD:dararma(playerid, params[])
{
    new string[62], arma, balas;
    if(sscanf(params, "us", arma, balas)) return SendClientMessage(playerid, COLOR_RED, "Uso: /dararma [id da arma] [quantidade de balas]");
    if(arma < 1 || arma > 38) return SendClientMessage(playerid, 0xFF0000FF, "Arma invбlida. Use de 1 б 38.");
    if(balas < 10 || balas > 9999) return SendClientMessage(playerid, 0xFF0000FF, "Uso Correto: Balas entre 10 ~ 9999");
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(GetDistanceBetweenPlayers(playerid, i) <= 30)
        {
            if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
            {
                GivePlayerWeapon(i, arma, balas);
            }
        }
    }
    return 1;
}
Simples..


Espero ter ajudado!

abraзo!
Reply
#7

Quote:
Originally Posted by Bieeel_Cwb
Посмотреть сообщение
pawn Код:
CMD:dararma(playerid, params[])
{
    new string[62], arma, balas;
    if(sscanf(params, "us", arma, balas)) return SendClientMessage(playerid, COLOR_RED, "Uso: /dararma [id da arma] [quantidade de balas]");
    if(arma < 1 || arma > 38) return SendClientMessage(playerid, 0xFF0000FF, "Arma invбlida. Use de 1 б 38.");
    if(balas < 10 || balas > 9999) return SendClientMessage(playerid, 0xFF0000FF, "Uso Correto: Balas entre 10 ~ 9999");
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(GetDistanceBetweenPlayers(playerid, i) <= 30)
        {
            if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
            {
                GivePlayerWeapon(i, arma, balas);
            }
        }
    }
    return 1;
}
Simples..


Espero ter ajudado!

abraзo!
mano agr ta dando esse erro : error 017: undefined symbol "params"
Reply
#8

Coloque arma no lugar.
Reply
#9

Quote:
Originally Posted by cicinho
Посмотреть сообщение
mano agr ta dando esse erro : error 017: undefined symbol "params"
Vocк usa zcmd?
Se nгo, sу adicionar
pawn Код:
#include <zcmd>
no comeзo do GameMode.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)