/veh command
#1

Hey,

I searched for a /veh spawning command and I found one, but when I compile it it gives the following errors
PHP код:
C:\Users\Gebruiker\Desktop\server\gamemodes\grandlarc.pwn(316) : error 003declaration of a local variable must appear in a compound block
C
:\Users\Gebruiker\Desktop\server\gamemodes\grandlarc.pwn(316) : warning 217loose indentation
C
:\Users\Gebruiker\Desktop\server\gamemodes\grandlarc.pwn(316) : error 017undefined symbol "String"
C:\Users\Gebruiker\Desktop\server\gamemodes\grandlarc.pwn(316) : warning 215expression has no effect
C
:\Users\Gebruiker\Desktop\server\gamemodes\grandlarc.pwn(316) : error 001expected token";"but found "]"
C:\Users\Gebruiker\Desktop\server\gamemodes\grandlarc.pwn(316) : fatal error 107too many error messages on one line 
This is my entire script:
PHP код:
#include <a_samp>
public OnGameModeInit()
{
    
// some code
    
CreateObject(36071300.45557169.5523225.58073,   0.000000.0000067.82463);
    
CreateObject(161511310.16003134.0597719.82454,   0.000000.00000333.26828);
    
CreateObject(14321304.92847132.4687819.59503,   0.000000.000000.00000);
    
CreateObject(14321306.75659137.7992719.49764,   0.000000.000000.00000);
    
CreateObject(14321303.53137137.6843619.49949,   0.000000.000000.00000);
    
CreateObject(14321305.59802135.1932519.58012,   0.000000.000000.00000);
    
CreateObject(14321302.52734134.5157919.54607,   0.000000.000000.00000);
    
CreateObject(17751314.34595140.6454820.30334,   0.000000.00000245.46411);
    
CreateObject(98331282.91980174.5224521.36313,   0.000000.00000356.52475);
    
CreateObject(6521292.24011152.5718819.41948,   0.000000.000000.00000);
    
CreateObject(6521305.55396184.8426119.43826,   0.000000.000000.00000);
    
CreateObject(98331296.68933144.3561921.36313,   0.000000.00000356.52475);
    
CreateObject(98331282.91980174.5224521.36313,   0.000000.00000356.52475);
    
CreateObject(98331314.00745190.9466721.36313,   0.000000.00000356.52475);
    
CreateObject(14321304.87524139.7491019.49949,   0.000000.000000.00000);
    
CreateObject(14321301.96289131.8535219.54607,   0.000000.000000.00000);
    
CreateObject(14321302.20081139.7808419.54607,   0.000000.000000.00000);
    
CreateObject(14321301.09131136.7968019.54607,   0.000000.000000.00000);
    
CreateObject(14321299.97571133.7131519.54607,   0.000000.000000.00000);
    return 
1;
}
public 
OnPlayerConnect(playerid)
{
    
// some code
    
RemoveBuildingForPlayer(playerid33391297.2813173.578119.46090.25);
    
RemoveBuildingForPlayer(playerid33401308.3984168.140619.40630.25);
    
RemoveBuildingForPlayer(playerid33411281.2266158.093819.34380.25);
    
RemoveBuildingForPlayer(playerid33431295.9844158.742219.38280.25);
    
RemoveBuildingForPlayer(playerid33431305.0391184.914119.34380.25);
    
RemoveBuildingForPlayer(playerid33451298.6094194.265619.32810.25);
    
RemoveBuildingForPlayer(playerid33451305.2656152.773419.29690.25);
    
RemoveBuildingForPlayer(playerid33441299.7109138.734419.34380.25);
    
RemoveBuildingForPlayer(playerid33441313.9688179.843819.35940.25);
    
RemoveBuildingForPlayer(playerid35941265.5703153.382819.46090.25);
    
RemoveBuildingForPlayer(playerid7691267.9141146.820319.19530.25);
    
RemoveBuildingForPlayer(playerid31701281.2266158.093819.34380.25);
    
RemoveBuildingForPlayer(playerid35941280.9297147.312520.00780.25);
    
RemoveBuildingForPlayer(playerid31681295.9844158.742219.38280.25);
    
RemoveBuildingForPlayer(playerid31711299.7109138.734419.34380.25);
    
RemoveBuildingForPlayer(playerid31721305.2656152.773419.29690.25);
    
RemoveBuildingForPlayer(playerid13081301.2578147.382818.82030.25);
    
RemoveBuildingForPlayer(playerid7801301.5938154.507819.32810.25);
    
RemoveBuildingForPlayer(playerid35941271.3125163.390619.43750.25);
    
RemoveBuildingForPlayer(playerid12941264.5469172.218823.00780.25);
    
RemoveBuildingForPlayer(playerid13081281.5156165.531318.82030.25);
    
RemoveBuildingForPlayer(playerid14401297.0703179.226619.94530.25);
    
RemoveBuildingForPlayer(playerid14401293.5547163.882819.94530.25);
    
RemoveBuildingForPlayer(playerid31681305.0391184.914119.34380.25);
    
RemoveBuildingForPlayer(playerid31691297.2813173.578119.46090.25);
    
RemoveBuildingForPlayer(playerid7751301.2734164.265619.35160.25);
    
RemoveBuildingForPlayer(playerid7641303.6328173.398418.93750.25);
    
RemoveBuildingForPlayer(playerid31711313.9688179.843819.35940.25);
    
RemoveBuildingForPlayer(playerid31671308.3984168.140619.40630.25);
    
RemoveBuildingForPlayer(playerid13081308.2656174.289118.82030.25);
    
RemoveBuildingForPlayer(playerid14401313.3203167.031319.94530.25);
    
RemoveBuildingForPlayer(playerid7091358.1484166.523419.46090.25);
    
RemoveBuildingForPlayer(playerid31721298.6094194.265619.32810.25);
    
RemoveBuildingForPlayer(playerid13081274.1875191.460918.82030.25);
    
RemoveBuildingForPlayer(playerid14381276.1172190.226618.60940.25);
    
RemoveBuildingForPlayer(playerid6171324.7266187.351617.78130.25);
    
RemoveBuildingForPlayer(playerid14401318.3828196.054719.60940.25);
    
RemoveBuildingForPlayer(playerid7051290.4766198.679718.76560.25);
    
RemoveBuildingForPlayer(playerid134411338.0625198.734430.02340.25);
    return 
1;
}
public 
OnPlayerSpawn(playerid) {
     
SetPlayerPos(playerid,1286.8938182.749620.2734);
     return 
1;
}
#include <a_samp>
#define FILTERSCRIPT
#if defined FILTERSCRIPT
#define l_red 0xFF0000AA
#define l_green 0x33FF33AA
new aVehicleNames[212][] =
{
    {
"Landstalker"},
    {
"Bravura"},
    {
"Buffalo"},
    {
"Linerunner"},
    {
"Perrenial"},
    {
"Sentinel"},
    {
"Dumper"},
    {
"Firetruck"},
    {
"Trashmaster"},
    {
"Stretch"},
    {
"Manana"},
    {
"Infernus"},
    {
"Voodoo"},
    {
"Pony"},
    {
"Mule"},
    {
"Cheetah"},
    {
"Ambulance"},
    {
"Leviathan"},
    {
"Moonbeam"},
    {
"Esperanto"},
    {
"Taxi"},
    {
"Washington"},
    {
"Bobcat"},
    {
"Mr Whoopee"},
    {
"BF Injection"},
    {
"Hunter"},
    {
"Premier"},
    {
"Enforcer"},
    {
"Securicar"},
    {
"Banshee"},
    {
"Predator"},
    {
"Bus"},
    {
"Rhino"},
    {
"Barracks"},
    {
"Hotknife"},
    {
"Trailer 1"},
    {
"Previon"},
    {
"Coach"},
    {
"Cabbie"},
    {
"Stallion"},
    {
"Rumpo"},
    {
"RC Bandit"},
    {
"Romero"},
    {
"Packer"},
    {
"Monster"},
    {
"Admiral"},
    {
"Squalo"},
    {
"Seasparrow"},
    {
"Pizzaboy"},
    {
"Tram"},
    {
"Trailer 2"},
    {
"Turismo"},
    {
"Speeder"},
    {
"Reefer"},
    {
"Tropic"},
    {
"Flatbed"},
    {
"Yankee"},
    {
"Caddy"},
    {
"Solair"},
    {
"Berkley's RC Van"},
    {
"Skimmer"},
    {
"PCJ-600"},
    {
"Faggio"},
    {
"Freeway"},
    {
"RC Baron"},
    {
"RC Raider"},
    {
"Glendale"},
    {
"Oceanic"},
    {
"Sanchez"},
    {
"Sparrow"},
    {
"Patriot"},
    {
"Quad"},
    {
"Coastguard"},
    {
"Dinghy"},
    {
"Hermes"},
    {
"Sabre"},
    {
"Rustler"},
    {
"ZR-350"},
    {
"Walton"},
    {
"Regina"},
    {
"Comet"},
    {
"BMX"},
    {
"Burrito"},
    {
"Camper"},
    {
"Marquis"},
    {
"Baggage"},
    {
"Dozer"},
    {
"Maverick"},
    {
"News Chopper"},
    {
"Rancher"},
    {
"FBI Rancher"},
    {
"Virgo"},
    {
"Greenwood"},
    {
"Jetmax"},
    {
"Hotring"},
    {
"Sandking"},
    {
"Blista Compact"},
    {
"Police Maverick"},
    {
"Boxville"},
    {
"Benson"},
    {
"Mesa"},
    {
"RC Goblin"},
    {
"Hotring Racer A"},
    {
"Hotring Racer B"},
    {
"Bloodring Banger"},
    {
"Rancher"},
    {
"Super GT"},
    {
"Elegant"},
    {
"Journey"},
    {
"Bike"},
    {
"Mountain Bike"},
    {
"Beagle"},
    {
"Cropdust"},
    {
"Stunt"},
    {
"Tanker"},
    {
"Roadtrain"},
    {
"Nebula"},
    {
"Majestic"},
    {
"Buccaneer"},
    {
"Shamal"},
    {
"Hydra"},
    {
"FCR-900"},
    {
"NRG-500"},
    {
"HPV1000"},
    {
"Cement Truck"},
    {
"Tow Truck"},
    {
"Fortune"},
    {
"Cadrona"},
    {
"FBI Truck"},
    {
"Willard"},
    {
"Forklift"},
    {
"Tractor"},
    {
"Combine"},
    {
"Feltzer"},
    {
"Remington"},
    {
"Slamvan"},
    {
"Blade"},
    {
"Freight"},
    {
"Streak"},
    {
"Vortex"},
    {
"Vincent"},
    {
"Bullet"},
    {
"Clover"},
    {
"Sadler"},
    {
"Firetruck LA"},
    {
"Hustler"},
    {
"Intruder"},
    {
"Primo"},
    {
"Cargobob"},
    {
"Tampa"},
    {
"Sunrise"},
    {
"Merit"},
    {
"Utility"},
    {
"Nevada"},
    {
"Yosemite"},
    {
"Windsor"},
    {
"Monster A"},
    {
"Monster B"},
    {
"Uranus"},
    {
"Jester"},
    {
"Sultan"},
    {
"Stratum"},
    {
"Elegy"},
    {
"Raindance"},
    {
"RC Tiger"},
    {
"Flash"},
    {
"Tahoma"},
    {
"Savanna"},
    {
"Bandito"},
    {
"Freight Flat"},
    {
"Streak Carriage"},
    {
"Kart"},
    {
"Mower"},
    {
"Duneride"},
    {
"Sweeper"},
    {
"Broadway"},
    {
"Tornado"},
    {
"AT-400"},
    {
"DFT-30"},
    {
"Huntley"},
    {
"Stafford"},
    {
"BF-400"},
    {
"Newsvan"},
    {
"Tug"},
    {
"Trailer 3"},
    {
"Emperor"},
    {
"Wayfarer"},
    {
"Euros"},
    {
"Hotdog"},
    {
"Club"},
    {
"Freight Carriage"},
    {
"Trailer 3"},
    {
"Andromada"},
    {
"Dodo"},
    {
"RC Cam"},
    {
"Launch"},
    {
"Police Car (LSPD)"},
    {
"Police Car (SFPD)"},
    {
"Police Car (LVPD)"},
    {
"Police Ranger"},
    {
"Picador"},
    {
"S.W.A.T. Van"},
    {
"Alpha"},
    {
"Phoenix"},
    {
"Glendale"},
    {
"Sadler"},
    {
"Luggage Trailer A"},
    {
"Luggage Trailer B"},
    {
"Stair Trailer"},
    {
"Boxville"},
    {
"Farm Plow"},
    {
"Utility Trailer"}
};
#endif
public OnPlayerCommandText(playeridcmdtext[])
{
    new 
cmd[200], idx;
    
cmd strtok(cmdtextidx);
    if(
strcmp(cmd"/veh"true10) == 0)
        
LINE 116 new String[200];
        new 
tmp[256];
        new 
Float:xFloat:yFloat:z;
        
tmp strtok(cmdtextidx);
        if(!
strlen(tmp)) return SendClientMessage(playeridl_red"You didn't give a vehicle name");
        new 
vehicle GetVehicleModelIDFromName(tmp);
        if(
vehicle 400 || vehicle 611) return SendClientMessage(playeridl_red"That vehicle name was not found");
        new 
Float:a;
        
GetPlayerFacingAngle(playerida);
        
GetPlayerPos(playeridxyz);
        if(
IsPlayerInAnyVehicle(playerid) == 1)
        {
            
GetXYInFrontOfPlayer(playeridxy8);
        }
        else
        {
            
GetXYInFrontOfPlayer(playeridxy5);
        }
        new 
PlayersVehicle CreateVehicle(vehiclexyza+90, -1, -1, -1);
        
LinkVehicleToInterior(PlayersVehicleGetPlayerInterior(playerid));
        
format(Stringsizeof(String), "You have spawned a %s"aVehicleNames[vehicle 400]);
        
SendClientMessage(playeridl_greenString);
        return 
1;
    }
    return 
0;
}
strtok(const string[], &index)
{
    new 
length strlen(string);
    while ((
index length) && (string[index] <= ' '))
    {
        
index++;
    }
    new 
offset index;
    new 
result[20];
    while ((
index length) && (string[index] > ' ') && ((index offset) < (sizeof(result) - 1)))
    {
        
result[index offset] = string[index];
        
index++;
    }
    
result[index offset] = EOS;
    return 
result;
}
GetVehicleModelIDFromName(vname[])
{
    for(new 
0211i++)
    {
        if(
strfind(aVehicleNames[i], vnametrue) != -1)
        return 
400;
    }
    return -
1;
}
stock GetXYInFrontOfPlayer(playerid, &Float:x2, &Float:y2Float:distance)
{
    new 
Float:a;
    
GetPlayerPos(playeridx2y2a);
    
GetPlayerFacingAngle(playerida);
    if(
GetPlayerVehicleID(playerid))
    {
        
GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
    }
    
x2 += (distance floatsin(-adegrees));
    
y2 += (distance floatcos(-adegrees));

I hope someone can help me!
Reply


Messages In This Thread
/veh command - by iiMo - 15.12.2015, 14:12
Re: /veh command - by ATGOggy - 15.12.2015, 15:34
Re: /veh command - by jlalt - 15.12.2015, 15:38
Re: /veh command - by iiMo - 15.12.2015, 17:36
Re: /veh command - by saffierr - 15.12.2015, 21:33
Re: /veh command - by iiMo - 16.12.2015, 13:33

Forum Jump:


Users browsing this thread: 1 Guest(s)