[Pedido] Converter comando para zcmd
#6

Quote:
Originally Posted by Ivison
Посмотреть сообщение
pawn Код:
CMD:car(playerid, params[])
{
        new String[200];
    new tmp[256];
    new Float:x, Float:y, Float:z;
    tmp = strtok(cmd, idx);
    if(!strlen(tmp)) return SendClientMessage(playerid,red, "SYNTAX: /car [car name]");
    new vehicle = GetVehicleModelIDFromName(tmp);
    if(vehicle < 400 || vehicle > 611) return SendClientMessage(playerid,red, "That vehicle name you have given was not found, please try again!");
    if(Veh[playerid][VehId] == -1)
    {
        new Float:a;
        GetPlayerFacingAngle(playerid, a);
        GetPlayerPos(playerid, x, y, z);
       
        if(IsPlayerInAnyVehicle(playerid) == 1)
        {
            GetXYInFrontOfPlayer(playerid, x, y, 8);
        }
        else
        {
            GetXYInFrontOfPlayer(playerid, x, y, 5);
        }
       
        new PlayersVehicle = CreateVehicle(vehicle, x, y, z, a+90, -1, -1, -1);
        Veh[playerid][VehId] = PlayersVehicle;
        LinkVehicleToInterior(PlayersVehicle, GetPlayerInterior(playerid));
    }
    else
    {
        DestroyVehicle(Veh[playerid][VehId]);
        new Float:a;
        GetPlayerFacingAngle(playerid, a);
        GetPlayerPos(playerid, x, y, z);
       
        if(IsPlayerInAnyVehicle(playerid) == 1)
        {
            GetXYInFrontOfPlayer(playerid, x, y, 8);
        }
        else
        {
            GetXYInFrontOfPlayer(playerid, x, y, 5);
        }
       
        new PlayersVehicle = CreateVehicle(vehicle, x, y, z, a+90, -1, -1, -1);
        Veh[playerid][VehId] = PlayersVehicle;
        LinkVehicleToInterior(PlayersVehicle, GetPlayerInterior(playerid));
    }
    format(String, sizeof(String), "You have spawned a %s", aVehicleNames[vehicle - 400]);
    SendClientMessage(playerid,green, String);
    return 1;
}
return 0;
}
Uso Zcmd e Sscanf2 e amigo quando ultiliza sscanf nao e poe : tmp = strtok(cmd, idx);
Reply


Messages In This Thread
Converter comando para zcmd - by zuero - 16.07.2014, 00:43
Re: Converter comando para zcmd - by MultiKill - 16.07.2014, 00:53
Re: Converter comando para zcmd - by zuero - 16.07.2014, 20:51
Re: Converter comando para zcmd - by zuero - 16.07.2014, 21:18
Re: Converter comando para zcmd - by _Play_ - 16.07.2014, 22:30
Re: Converter comando para zcmd - by zuero - 16.07.2014, 22:46
Re: Converter comando para zcmd - by _Play_ - 16.07.2014, 22:49
Re: Converter comando para zcmd - by zuero - 16.07.2014, 22:53
Re: Converter comando para zcmd - by _Play_ - 16.07.2014, 23:00
Re: Converter comando para zcmd - by zuero - 16.07.2014, 23:03

Forum Jump:


Users browsing this thread: 2 Guest(s)