11.06.2012, 00:51
(
Последний раз редактировалось Stevee; 11.06.2012 в 15:17.
)
Hi, I'm using the PPC Trucking gamemode (0.3c), with the 0.3e server, I don't know if this is the cause of my problem, but I doubt it.
I'm receiving a few errors from a command I tried to create, it is my first ever command (lol) so it probably won't even work, but I'd still like to know where I'm going wrong and whats causing the errors.
Here are the errors I'm receiving:
and here is the function code:
I'm sorry to ask for help, but I've looked around for ages and I can't find a single thing that'll help me.
I'm receiving a few errors from a command I tried to create, it is my first ever command (lol) so it probably won't even work, but I'd still like to know where I'm going wrong and whats causing the errors.
Here are the errors I'm receiving:
Код:
PPC_PlayerCommands.inc(2425) : error 003: declaration of a local variable must appear in a compound block PPC_PlayerCommands.inc(2427) : error 010: invalid function or declaration PPC_PlayerCommands.inc(2430) : error 010: invalid function or declaration PPC_PlayerCommands.inc(2433) : error 010: invalid function or declaration PPC_PlayerCommands.inc(2436) : error 010: invalid function or declaration PPC_PlayerCommands.inc(2439) : error 021: symbol already defined: "GetVehicleParamsEx" PPC_PlayerCommands.inc(2442) : error 010: invalid function or declaration PPC_PlayerCommands.inc(2444) : error 010: invalid function or declaration PPC_PlayerCommands.inc(2445) : error 010: invalid function or declaration PPC_PlayerCommands.inc(2448) : error 021: symbol already defined: "SetVehicleParamsEx" PPC_PlayerCommands.inc(2451) : error 010: invalid function or declaration PPC_PlayerCommands.inc(2454) : error 010: invalid function or declaration PPC_PlayerCommands.inc(2457) : error 010: invalid function or declaration PPC_PlayerCommands.inc(2458) : error 010: invalid function or declaration PPC_PlayerCommands.inc(2461) : error 010: invalid function or declaration
Код:
COMMAND:rengine(playerid, params[]) -- Line 2423
{ -- Line 2424
// Show /rengine was used -- Line 2425
SendAdminText(playerid, "/rengine", params); -- Line 2426
-- Line 2427
// Declare local variables -- Line 2428
new OtherPlayer, vehicleid, engine, lights, alarm, doors, bonnet, boot, objective; -- Line 2429
-- Line 2430
// Check if the player is logged in -- Line 2431
if(APlayerData[playerid][LoggedIn] == true) -- Line 2432
{ -- Line 2433
// Check if the player has atleast level 5 -- Line 2434
if(APlayerData[playerid][PlayerLevel] >= 5) -- Line 2435
-- Line 2436
// Check if the other player is logged in -- Line 2437
if(IsPlayerConnected(OtherPlayer)) -- Line 2438
{ -- Line 2439
// Get the other players vehicle -- Line 2440
vehicleid = GetPlayerVehicleID(OtherPlayer); -- Line 2441
-- Line 2442
// Get the current status of the other players vehicle -- Line 2443
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective); -- Line 2444
-- Line 2445
// Check if the other player is inside a vehicle -- Line 2446
if(vehicleid != 0) -- Line 2447
{ -- Line 2448
if(sscanf(params, "i", engine)) -- Line 2449
{ -- Line 2450
SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/engine <EngineStatus 0/1>\""); -- Line 2451
else -- Line 2452
{ -- Line 2453
// Set the engine to the value that was passed by the player and leave all the other parameters alone -- Line 2454
SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective); -- Line 2455
} -- Line Line 2456
} -- Line 2457
else -- Line 2458
SendClientMessage(playerid, 0x00FF00FF, "Your target must be inside a vehicle to toggle their engine"); -- Line 2459
} -- Line 2460
else -- Line 2461
SendClientMessage(playerid, 0xFF0000FF, "Player is not online!"); -- Line 2462
} -- Line 2463
else -- Line 2464
return 0;[COLOR="DarkOrange"] -- Line 2465 -- Line 2466
// Let the server know that this was a valid command -- Line 2467
return 1; -- Line 2468
} -- Line 2469


