05.02.2015, 17:34
titulo ja explica tudo
aguardando...
aguardando...
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);
}
Uma base.
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;
}
pawn Код:
Espero ter ajudado! abraзo! |