Omg stupid problem!!!
#1

hey there
I got this problem with jacking
The define
Код:
new jacar_First,jacar_Last;
Код:
#define IsAJackAble(%0) (jacar_First <= (%0) <= jacar_Last)
Код:
jacar_First = AddStaticVehicleEx(426,893.13018799,-1658.10461426,13.36687469,180.00000000,-1,-1,10000); //Premier
AddStaticVehicleEx(466,887.97174072,-1668.82861328,13.46687508,0.00000000,-1,-1,10000); //Glendale
AddStaticVehicleEx(529,1063.51867676,-1772.33984375,13.09715843,270.00000000,-1,-1,10000); //Willard
AddStaticVehicleEx(585,1098.65600586,-1766.82727051,13.04896259,90.00000000,-1,-1,10000); //Emperor
AddStaticVehicleEx(507,1086.07128906,-1371.49780273,13.73124981,181.50000000,-1,-1,10000); //Elegant
AddStaticVehicleEx(498,-529.34808350,-472.51901245,25.73343658,179.00000000,-1,-1,10000); //Boxville
AddStaticVehicleEx(543,1025.41394043,1795.11071777,10.77031231,264.00000000,-1,-1,10000); //Sadler
AddStaticVehicleEx(467,1112.06945801,1767.50207520,10.69031239,0.00000000,-1,-1,10000); //Oceanic
AddStaticVehicleEx(516,1116.54296875,2264.51611328,16.61874962,0.00000000,-1,-1,10000); //Nebula
jacar_Last = AddStaticVehicleEx(445,1116.71069336,2195.98071289,16.70874977,0.00000000,-1,-1,10000); //Admiral
the cars add:


then the command
dcmd(jack,4,cmdtext);

Код:
dcmd_jack(playerid,newstate,params[])
{
	#pragma unused params
	if(PlayerInfo[playerid][pJob] != 1) return SendClientMessage(playerid,COLOR_AFOR,"You are not a car jacker !");
	if(PlayerInfo[playerid][pJob] == 1)
	{
 		if( newstate == PLAYER_STATE_DRIVER )
 		{
        newstate = GetPlayerVehicleID(playerid);
	        if(IsAJackAble(newstate))
			{
				//blablabla
			}
        }
	}
	return 1;
}
Код:
error 035: argument type mismatch (argument 2)
Reply
#2

Which line is the error?
Reply
#3

dcmd(jack,4,cmdtext);
Reply
#4

You cannot change that to whatever you want...

try this

pawn Код:
dcmd_jack(playerid, params[])
{
    #pragma unused params
    new newstate;
    if(PlayerInfo[playerid][pJob] != 1) return SendClientMessage(playerid,COLOR_AFOR,"You are not a car jacker !");
    if(PlayerInfo[playerid][pJob] == 1)
    {
        if( newstate == PLAYER_STATE_DRIVER )
        {
            newstate = GetPlayerVehicleID(playerid);
            if(IsAJackAble(newstate))
            {
                //blablabla
            }
        }
    }
    return 1;
}
Reply
#5

Okey no errors
this is the command

Код:
dcmd_jack(playerid,params[])
{
	#pragma unused params
	if(PlayerInfo[playerid][pJob] != 1) return SendClientMessage(playerid,COLOR_AFOR,"You are not a car jacker !");
	new newstate;
	if(PlayerInfo[playerid][pJob] == 1)
	{
 		if( newstate == PLAYER_STATE_DRIVER )
 		{
        	newstate = GetPlayerVehicleID(playerid);
	        if(IsAJackAble(newstate))
			{
				SendClientMessage(playerid,COLOR_AFOR,"Jacked!");
			}else return SendClientMessage(playerid,COLOR_AFOR,"This car is unjackable !");
        }else return SendClientMessage(playerid,COLOR_AFOR,"You are not the driver !");
	}
	return 1;
}
No errors.
But It allways tells me that im not the driver .
Reply
#6

Try this

pawn Код:
dcmd_jack(playerid,params[])
{
    #pragma unused params
    new newstate;
    if(PlayerInfo[playerid][pJob] != 1) return SendClientMessage(playerid,-COLOR_AFOR,"You are not a car jacker !");
    else if(PlayerInfo[playerid][pJob] == 1)
    {
        if(newstate != PLAYER_STATE_DRIVER) return SendClientMessage(playerid,COLOR_AFOR,"This car is unjackable !");
        newstate = GetPlayerVehicleID(playerid);
        if(IsAJackAble(newstate)) return SendClientMessage(playerid,COLOR_AFOR,"Jacked!");
    }
    return 1;
}
And use [ pawn ] [ /pawn ] tags next time please
Reply
#7

Still... the same thing.
Reply
#8

I cant see the problem for now, are you sure you are even job id 1?
Reply
#9

yes
and Your command would really mess it
I made this
pawn Код:
dcmd_jack(playerid,params[])
{
#pragma unused params
new newstate;
if(PlayerInfo[playerid][pJob] != 1) return SendClientMessage(playerid,COLOR_AFOR,"You are not a car jacker !");
    else if(PlayerInfo[playerid][pJob] == 1)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
        if(newstate != PLAYER_STATE_DRIVER) return SendClientMessage(playerid,COLOR_AFOR,"You are not the driver!");
        newstate = GetPlayerVehicleID(playerid);
        if(IsAJackAble(newstate))
        {
        SendClientMessage(playerid,COLOR_AFOR,"Jacked!");
        }
        }
    }
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)