argument type mismatch (argument 2) car engine problem
#1

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.
Reply
#2

did u define the colors??
Reply
#3

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
Reply
#4

@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_ <<
Reply
#5

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.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)