Vehicleid -
MatriXgaMer - 11.01.2014
Hello i have this code:
pawn Код:
CMD:motor(playerid, params[])
{
new alarm, doors, bonnet, boot, objective;
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
GameTextForPlayer(playerid, "PALJENJE MOTORA...", 3000, 3);
SetTimerEx("Automobil", 3000, false, "i", playerid);
}
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(GetVehicleParamsEx(vehicleid, 1, 1, alarm, doors, bonnet, boot, objective))
{
GameTextForPlayer(playerid, "GASENJE MOTORA...", 3000, 3);
SetTimerEx("AutomobilDown", 3000, false, "i", playerid);
}
}
return 1;
}
and this will start my engine and i added if(GetVehicleParamsEx(vehicleid, 1, 1, alarm, doors, bonnet, boot, objective)) that it checks is the player car on, but i have this:
pawn Код:
C:\Users\matRixgameR\Desktop\samp03x_svr_R2_win32\gamemodes\script.pwn(126) : error 017: undefined symbol "vehicleid"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.
i was trying o put new vehicleid[MAX_VEHICLES]; then i get this:
pawn Код:
C:\Users\matRixgameR\Desktop\samp03x_svr_R2_win32\gamemodes\script.pwn(126) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.
my timers if needed.
pawn Код:
forward Automobil(playerid);
public Automobil(playerid)
{
new str[128];
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(GetPlayerVehicleID(playerid), 1, 1, alarm, doors, bonnet, boot, objective);
GameTextForPlayer(playerid, "USPESNO PALJENJE MOTORA", 3000, 3);
format(str, sizeof(str), ""COL_PINK"* %s okrece kljuc i pali motor vozila.", getRoleplayName(playerid));
SendClientMessage(playerid, 0xfffff, str);
ProxDetector(20, playerid, str, COLOR_PINK);
return 1;
}
forward AutomobilDown(playerid);
public AutomobilDown(playerid)
{
new str[128];
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(GetPlayerVehicleID(playerid), 1, 1, alarm, doors, bonnet, boot, objective);
GameTextForPlayer(playerid, "USPESNO GASENJE MOTORA", 3000, 3);
format(str, sizeof(str), ""COL_PINK"* %s okrece kljuc i gasi motor vozila.", getRoleplayName(playerid));
SendClientMessage(playerid, 0xfffff, str);
ProxDetector(20, playerid, str, COLOR_PINK);
return 1;
}
Re: Vehicleid -
Eth - 11.01.2014
new vehicleid = GetPlayerVehicleID(playerid);
Re: Vehicleid -
Burridge - 11.01.2014
pawn Код:
new vehicleid = GetPlayerVehicleID(playerid);
Add this to your command before the GetVehicleParamsEx line.
Re: Vehicleid -
amirab - 11.01.2014
you're problem is in this line
if(GetVehicleParamsEx(vehicleid, 1, 1, alarm, doors, bonnet, boot, objective))
use this :
PHP код:
new vehicleid = GetPlayerVehicleID(playerid);
if(GetVehicleParamsEx(vehicleid, 1, 1, alarm, doors, bonnet, boot, objective))
Re: Vehicleid -
MatriXgaMer - 11.01.2014
pawn Код:
error 035: argument type mismatch (argument 2)
Re: Vehicleid -
Eth - 11.01.2014
please show us the error line.
Re: Vehicleid -
MatriXgaMer - 11.01.2014
FIXED IT!