Problema
#3

No es necesario hacer un ciclo, ya que el id del vehнculo ya lo conoces.
pawn Код:
#include <a_samp>

native IsValidVehicle(vehicleid);

CMD:traerveh(playerid, params[])
{
    new vehicleid, pool = GetVehiclePoolSize();
    if(PlayerInfo[playerid][jAdminXLEP] == 0) return SendClientMessage(playerid, COLOR_GRAD, "Necesitas ser administrador para usar este comando.");
    if(sscanf(params, "i", vehicleid)) return SendClientMessage(playerid, COLOR_GRAD, "Modo de uso: /traerveh [ID]");
    if(vehicleid < 1 || vehicleid > pool) return SendClientMessage(playerid, COLOR_GRAD, "El vehiculo con ese id no existe.");
    if(!IsValidVehicle(vehicleid)) return SendClientMessage(playerid, COLOR_GRAD, "El vehiculo con ese id es invalido.");

    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    SetVehiclePos(vehicleid, x, y + 4, z);
    SendClientMessage(playerid, COLOR_VERDE, "Has traido el coche seleccionado.");
    return 1;
}
https://sampwiki.blast.hk/wiki/IsValidVehicle

Y no utilices params[0] (por ejemplo) como un NUMERO, porque es un dato tipo CARACTER.
Reply


Messages In This Thread
Problema GetVehiclePoolSize - by Unrea1 - 27.05.2015, 23:32
Re: Problema - by Unrea1 - 28.05.2015, 00:42
Re: Problema - by SickAttack - 28.05.2015, 02:06

Forum Jump:


Users browsing this thread: 1 Guest(s)