Vehicleid
#1

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;
}
Reply
#2

new vehicleid = GetPlayerVehicleID(playerid);
Reply
#3

pawn Код:
new vehicleid = GetPlayerVehicleID(playerid);
Add this to your command before the GetVehicleParamsEx line.
Reply
#4

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(vehicleid11alarmdoorsbonnetbootobjective)) 
Reply
#5

pawn Код:
error 035: argument type mismatch (argument 2)
Reply
#6

please show us the error line.
Reply
#7

FIXED IT!
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)