What's the problem here -.-
#1

pawn Код:
CMD:sellmyveh(playerid, params[])
{
    new id, price, Float: x, Float: y, Float: z, string[128];
    for(new v = 0; v < MAX_PLAYER_VEHICLES; v++) {
        if(IsPlayerInVehicle(playerid, playerVehicles[playerid][v][cID])) {
            if(sscanf(params, "ud", id, price)) return SendClientMessage(playerid, COLOR_GREY, "[USAGE]: /sellmyveh [playerid] [price]");
            if(IsPlayerConnected(id)) {
                GetPlayerPos(id, x, y, z);
                if(IsPlayerInRangeOfPoint(playerid, 5.0, x, y, z)) {
                    format(string, sizeof(string), "%s has offered you to buy their %s for $%d. (/accept vehicle)", GetPlayerNameEx(playerid), VehicleName[playerVehicles[playerid][GetPlayerVehicleID(playerid)][cModelID] - 400], price);
                    SendClientMessage(id, COLOR_LIGHTBLUE, string);
                    format(string, sizeof(string), "You have offered %s to buy your %s for $%d.", GetPlayerNameEx(id), VehicleName[playerVehicles[playerid][GetPlayerVehicleID(playerid)][cModelID] - 400], price);
                    SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
                    SetPVarInt(id, "carSeller", playerid);
                    SetPVarInt(id, "carPrice", price);
                    SetPVarInt(id, "carSaleID", GetPlayerVehicleID(playerid));
                }
                else SendClientMessage(playerid, COLOR_GREY, "You are not close enough to that player!");
            }
            else SendClientMessage(playerid, COLOR_GREY, "Invalid player ID!");
        }
        else SendClientMessage(playerid, COLOR_GREY, "You need to be inside a vehicle that you own to do this!");
    }
    return 1;
}
Okay, this is when a player enter's the vehicle - I have debugged the fuck out of the vehicle loading system and it loads fine. But for some reason, when I do the command in my vehicle it says I need to be in a vehicle I own, but if I do it in car slot 0(my 1st car) it will work? Any idea, this has really been bugging me, I have tried everything to resolve this ;/
Reply


Messages In This Thread
What's the problem here -.- - by MattSlater - 28.12.2012, 03:23
Re: What's the problem here -.- - by MattSlater - 28.12.2012, 07:10
Re: What's the problem here -.- - by rockerman - 28.12.2012, 07:18
Re: What's the problem here -.- - by Threshold - 28.12.2012, 08:52
Re: What's the problem here -.- - by MattSlater - 28.12.2012, 16:02
Re: What's the problem here -.- - by MattSlater - 28.12.2012, 23:15

Forum Jump:


Users browsing this thread: 2 Guest(s)