/getcar problem. Only spawns car IDs up to 3 or 4
#1

Hi, here is my /getcar CMD. This spawns car IDs to the users location. The only problem is it only spawns up to car ID 2. We had 3 players online at the time we tested the command.

pawn Код:
CMD:getcar(playerid, params[]) {
        if(playerVariables[playerid][pAdminLevel] >= 3)
        {
            new vehid,messageString[64],logString[64],Float:x, Float:y, Float:z, Float:vehx, Float:vehy, Float:vehz;
            if(sscanf(params, "u", vehid))
            {
                SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/getcar [vehicleid]");
                return 1;
            }
            if(vehid != INVALID_VEHICLE_ID)
            {
                GetPlayerPos(playerid, x, y, z);
                GetVehiclePos(vehid, vehx, vehy, vehz);
                SetVehiclePos(vehid, x, y+4, z+1);
                SetVehicleVirtualWorld(vehid, GetPlayerVirtualWorld(playerid));
                LinkVehicleToInterior(vehid, GetPlayerInterior(playerid));
                format(messageString, sizeof(messageString), "You have teleported car ID {CD0000}%d{FFFFFF} to your location.", vehid);
                SendClientMessage(playerid, COLOR_WHITE, messageString);

                format(logString, sizeof(logString), "%s has teleported car ID %d (coords: %d, %d, %d)", playerVariables[playerid][pNormalName], vehid, vehx, vehy, vehz);
                mysql_real_escape_string(logString, logString);
                adminLog(logString);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "Invalid vehicle ID.");
            }
        }
        return 1;
}
Reply


Messages In This Thread
/getcar problem. Only spawns car IDs up to 3 or 4 [FIXED!] - by Sledge - 07.08.2011, 04:50
Re: /getcar problem. Only spawns car IDs up to 3 or 4 - by Calgon - 07.08.2011, 05:21
Re: /getcar problem. Only spawns car IDs up to 3 or 4 - by [HiC]TheKiller - 07.08.2011, 05:22
Re: /getcar problem. Only spawns car IDs up to 3 or 4 - by Sledge - 07.08.2011, 05:22

Forum Jump:


Users browsing this thread: 2 Guest(s)