SA-MP Forums Archive
argument type mismatch (argument 2) car engine problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: argument type mismatch (argument 2) car engine problem (/showthread.php?tid=475858)



argument type mismatch (argument 2) car engine problem - Mey6155 - 15.11.2013

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    new engine;
    new vehicleid=GetPlayerVehicleID(playerid);
    if(newkeys & KEY_NO)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(GetPlayerState(playerid)==PLAYER_STATE_DRIVER)
            {
                new lights,alarm,doors,bonnet,boot,objective;
                GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
           
                if(engine == 0)
                {
                    SetVehicleParamsEx(vehicleid,1,0,0,0,0,0,0);
                    SendClientMessage(playerid,COL_GREEN,"The engine is turned on");// ERROR 1
                }
           
                if(engine == 1)
                {
                    SetVehicleParamsEx(vehicleid,0,0,0,0,0,0,0);
                    SendClientMessage(playerid,COL_RED,"The engine is turned off"); // ERROR 2
                }
            }
        }
    }
    return 1;
}
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        if(Engine[playerid]==0)
        {
            if(GetPlayerState(playerid)==PLAYER_STATE_DRIVER)
            {
                SendClientMessage(playerid,COL_GREEN,"Press N to turn engine on/off"); // ERROR 3
                Engine[playerid] = 1;
            }
        }
    }
    if(newstate==PLAYER_STATE_ONFOOT)
    {
        Engine[playerid]=0;
    }
    return 1;
}
My defineON THE TOP OF THE SCRIPT!)
pawn Код:
new Engine[MAX_PLAYERS];
My Errors :
Код:
C:\Users\LG\Desktop\Mustafa\LV RP\gamemodes\RPLV.pwn(160) : error 035: argument type mismatch (argument 2)
C:\Users\LG\Desktop\Mustafa\LV RP\gamemodes\RPLV.pwn(263) : error 035: argument type mismatch (argument 2)
C:\Users\LG\Desktop\Mustafa\LV RP\gamemodes\RPLV.pwn(269) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Hope you guys can help me out.


Re: argument type mismatch (argument 2) car engine problem - newbie scripter - 15.11.2013

did u define the colors??


Re: argument type mismatch (argument 2) car engine problem - Stanford - 15.11.2013

Please post the lines that have the errors only so we can know,
and I share newbie scripter's opinion, maybe that COL_GREEN 0.3c colors you can't use them like that, just put instead of COL ---> COLOR_GREEN and try


Re: argument type mismatch (argument 2) car engine problem - Mey6155 - 15.11.2013

@Newbie scripter here are my defines i changed them to COLOR <<
#define COLOR_WHITE "{FFFFFF}"
#define COLOR_RED "{F81414}"
#define COLOR_GREEN "{00FF22}"
#define COLOR_LIGHTBLUE "{00CED1}"

@Stanford I changd them to COLOR_ <<


Re: argument type mismatch (argument 2) car engine problem - Konstantinos - 15.11.2013

pawn Код:
#define COLOR_WHITE 0xFFFFFFFF
#define COLOR_RED 0xF81414FF
#define COLOR_GREEN 0x00FF22FF
#define COLOR_LIGHTBLUE 0x00CED1FF
The color parameter needs an integer and you used a string.

Use COLOR_... instead.