Car Commands Bugging
#2

Maybe this works..

pawn Код:
CMD:car(playerid, params[])
{
    new car[50],color1,color2,message[75], Float:pPos[4],VehicleID;
    if(DM[playerid] == 1) return SendClientMessage(playerid, -1,""red"[ ERROR ]: "yellow"You can't use this command while deathmatch!");
    if(DUEL[playerid] == 1) return SendClientMessage(playerid, -1,""red"[ ERROR]: "yellow"You can't use this command while duel!");
    if(AccInfo[playerid][Cars] != 0) DestroyVehicle(AccInfo[playerid][Cars]);
    if(sscanf(params,"s[50]D(6)D(0)",car,color1,color2)) SendClientMessage(playerid, -1, ""red"[ USAGE ]: "yellow"/car [ ID/CARNAME ] [Color 1] [Color 2]");
    else{
        VehicleID = GetVehicleModelIDFromName(car);
        if(VehicleID == -1)
        {
            VehicleID = strval(car);
            if(VehicleID < 400 || VehicleID > 611) return SendClientMessage(playerid, -1, ""red"[ ERROR ]: "yellow"You entered an invalid vehiclename!");
        }
        new Model = ReturnVehicleID(params);
        if(AccInfo[playerid][LesenKereta] == 0)
        {
                if(Model != INVALID_VEHICLE_ID)
                {
                        if(strlen(params) > 8) params[8] = EOS;
                        Model = strval(params);
                        if(!(400 <= Model <= 611))
                        return SendClientMessage(playerid, -1, ""red"[ ERROR ]: "yellow"You entered an invalid vehiclename!");
                        GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
                        GetPlayerFacingAngle(playerid, pPos[3]);
                        AccInfo[playerid][Cars] = CreateVehicle(Model, pPos[0], pPos[1], pPos[2] + 1, pPos[3], 0, 1, 60);
                        PutPlayerInVehicle(playerid, AccInfo[playerid][Cars], 0);
                        format(message, sizeof(message), ""red"[ UFM ]: "yellow"You have spawned %s[%d]!", GetVehicleNames(AccInfo[playerid][Cars]),VehicleID);
                        SendClientMessage(playerid, -1, message);
                }
        } else if(AccInfo[playerid][LesenKereta] == 1){
        GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
        GetPlayerFacingAngle(playerid, pPos[3]);
        AccInfo[playerid][Cars] = CreateVehicle(Model, pPos[0], pPos[1], pPos[2] + 1, pPos[3], 0, 1, 60);
        PutPlayerInVehicle(playerid, AccInfo[playerid][Cars], 0);
        format(message, sizeof(message), ""red"[ UFM ]: "yellow"You have spawned %s[%d]!", GetVehicleNames(AccInfo[playerid][Cars]),VehicleID);
        SendClientMessage(playerid, -1, message);
        }
    }
    return 1;
}
Reply


Messages In This Thread
Car Commands Bugging - by dh240473 - 15.07.2016, 09:00
Re: Car Commands Bugging - by TaiRinsuru - 15.07.2016, 09:05
Re: Car Commands Bugging - by dh240473 - 15.07.2016, 09:36
Re: Car Commands Bugging - by FuNkYTheGreat - 15.07.2016, 09:44
Re: Car Commands Bugging - by dh240473 - 15.07.2016, 10:53
Re: Car Commands Bugging - by dh240473 - 15.07.2016, 14:34
Re: Car Commands Bugging - by vikoo - 15.07.2016, 15:25

Forum Jump:


Users browsing this thread: 2 Guest(s)