/dararmas a todos proximos -
cicinho - 05.02.2015
titulo ja explica tudo
aguardando...
Re: /dararmas a todos proximos -
NexNix - 05.02.2015
IsPlayerInRangeOfPoint
Re: /dararmas a todos proximos -
Bieeel_Cwb - 05.02.2015
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);
}
Respuesta: Re: /dararmas a todos proximos -
cicinho - 05.02.2015
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
Re: Respuesta: Re: /dararmas a todos proximos - JkS - 05.02.2015
-----------------------------
Re: /dararmas a todos proximos -
Bieeel_Cwb - 05.02.2015
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!
Respuesta: Re: /dararmas a todos proximos -
cicinho - 05.02.2015
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"
Re: /dararmas a todos proximos -
ZeZin - 05.02.2015
Coloque arma no lugar.
Re: Respuesta: Re: /dararmas a todos proximos -
ipsLuan - 05.02.2015
Quote:
Originally Posted by cicinho
mano agr ta dando esse erro : error 017: undefined symbol "params"
|
Vocк usa zcmd?
Se nгo, sу adicionar
no comeзo do GameMode.