Tag Mismatch Warning
#1

Код:
new vehicleid = (playerid, 5.0);
It cant add "Float"
Reply
#2

You are defining vehicleid with arguments and no function is being used, you must use a function there.

Example: new vehicleid = GetPlayerVehicleID(playerid);

but if you show more than the line, it'd be better.
Reply
#3

What are you trying to do... ?
Reply
#4

Quote:
Originally Posted by Farzam
Посмотреть сообщение
You are defining vehicleid with arguments and no function is being used, you must use a function there.

Example: new vehicleid = GetPlayerVehicleID(playerid);

but if you show more than the line, it'd be better.
Quote:
Originally Posted by iLearner
Посмотреть сообщение
What are you trying to do... ?
Код:
CMD:bwear(playerid, params[])
{
    if(GetPlayerBackpack(playerid) != BACKPACK_NULL) return SendClientMessage(playerid, 0xFF0000FF, "You already have a backpack.");

    if(GetPlayerInterior(playerid) == 0)
    {
        new vehicleid = (playerid, 5.0);
        if(vehicleid)
        {
            new Float:x, Float:y, Float:z;
            GetVehiclePos(vehicleid, x, y, z);
            if(IsPlayerInRangeOfPoint(playerid, 4.0, x, y, z))
            {
                if(!IsPlayerVehicle(playerid, vehicleid))return SendClientMessage(playerid, 0xFF0000FF, "You can only take out backpack from your persnal car.");
                if(GetPlayerVehicleSlot(playerid, vehicleid) == pBackpackStored[playerid][0])
                {
                    new engine, lights, alarm, doors, bonnet, boot, objective;
                    GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
                    SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, VEHICLE_PARAMS_ON, objective);
                    pBackpackStored[playerid][0] = 0;
                    GivePlayerBackpack(playerid, pBackpackStored[playerid][1]);
                    pBackpackStored[playerid][1] = 0;
                    KillTimer(tmCloseVehicleTrunk[playerid]);
                    tmCloseVehicleTrunk[playerid] = SetTimerEx("CloseVehicleTrunk", 1500, false, "ii", playerid, vehicleid);

                    new string[144];
                    format(string, sizeof(string), "{FF8000}* {C2A2DA}%s takes their backpack out of the car trunk.", PlayerNameEx(playerid));
                    SendNearbyMessage(100, 10, playerid, 0xC2A2DAFF, string);
                }
                else SendClientMessage(playerid, 0xFF0000FF, "You haven't stored your backpack in their vehicle.");
            }
            else SendClientMessage(playerid, 0xFF0000FF, "You're not close enough to a vehicle or in a house.");
        }
    }
    else
    {
        if((GetPlayerInterior(playerid) == HouseInfo[PlayerInfo[playerid][pPhousekey]][hExtIW] && GetPlayerVirtualWorld(playerid) == HouseInfo[PlayerInfo[playerid][pPhousekey]][hExtVW] && pBackpackStored[playerid][0] == HouseInfo[PlayerInfo[playerid][pPhousekey]][hSQLId])
			|| (GetPlayerInterior(playerid) == HouseInfo[PlayerInfo[playerid][pPhousekey2]][hExtIW] && GetPlayerVirtualWorld(playerid) == HouseInfo[PlayerInfo[playerid][pPhousekey2]][hExtVW] && pBackpackStored[playerid][0] == HouseInfo[PlayerInfo[playerid][pPhousekey2]][hSQLId]) )
		{
        	pBackpackStored[playerid][0] = 0;
        	GivePlayerBackpack(playerid, pBackpackStored[playerid][1]);
        	pBackpackStored[playerid][1] = 0;

        	new string[144];
        	format(string, sizeof(string), "{FF8000}* {C2A2DA}%s (%d) takes their backpack out of the house locker.", PlayerNameEx(playerid), playerid);
			SendNearbyMessage(100, 10, playerid, 0xC2A2DAFF, string);
		}
		SendClientMessage(playerid, 0xFF0000FF, "You have not stored backpack in this house!");
    }
    return 1;
}
Reply
#5

You have this:

PHP код:
new vehicleid = (playerid5.0); 
Which doesn't really get your vehicle ID, so you have to replace it with this:

PHP код:
new vehicleid GetPlayerVehicleID(playerid); 
Fixed code:

PHP код:
CMD:bwear(playeridparams[])
{
    if(
GetPlayerBackpack(playerid) != BACKPACK_NULL) return SendClientMessage(playerid0xFF0000FF"You already have a backpack.");

    if(
GetPlayerInterior(playerid) == 0)
    {
        new 
vehicleid GetPlayerVehicleID(playerid);
        if(
vehicleid)
        {
            new 
Float:xFloat:yFloat:z;
            
GetVehiclePos(vehicleidxyz);
            if(
IsPlayerInRangeOfPoint(playerid4.0xyz))
            {
                if(!
IsPlayerVehicle(playeridvehicleid))return SendClientMessage(playerid0xFF0000FF"You can only take out backpack from your persnal car.");
                if(
GetPlayerVehicleSlot(playeridvehicleid) == pBackpackStored[playerid][0])
                {
                    new 
enginelightsalarmdoorsbonnetbootobjective;
                    
GetVehicleParamsEx(vehicleidenginelightsalarmdoorsbonnetbootobjective);
                    
SetVehicleParamsEx(vehicleidenginelightsalarmdoorsbonnetVEHICLE_PARAMS_ONobjective);
                    
pBackpackStored[playerid][0] = 0;
                    
GivePlayerBackpack(playeridpBackpackStored[playerid][1]);
                    
pBackpackStored[playerid][1] = 0;
                    
KillTimer(tmCloseVehicleTrunk[playerid]);
                    
tmCloseVehicleTrunk[playerid] = SetTimerEx("CloseVehicleTrunk"1500false"ii"playeridvehicleid);

                    new 
string[144];
                    
format(stringsizeof(string), "{FF8000}* {C2A2DA}%s takes their backpack out of the car trunk."PlayerNameEx(playerid));
                    
SendNearbyMessage(10010playerid0xC2A2DAFFstring);
                }
                else 
SendClientMessage(playerid0xFF0000FF"You haven't stored your backpack in their vehicle.");
            }
            else 
SendClientMessage(playerid0xFF0000FF"You're not close enough to a vehicle or in a house.");
        }
    }
    else
    {
        if((
GetPlayerInterior(playerid) == HouseInfo[PlayerInfo[playerid][pPhousekey]][hExtIW] && GetPlayerVirtualWorld(playerid) == HouseInfo[PlayerInfo[playerid][pPhousekey]][hExtVW] && pBackpackStored[playerid][0] == HouseInfo[PlayerInfo[playerid][pPhousekey]][hSQLId])
            || (
GetPlayerInterior(playerid) == HouseInfo[PlayerInfo[playerid][pPhousekey2]][hExtIW] && GetPlayerVirtualWorld(playerid) == HouseInfo[PlayerInfo[playerid][pPhousekey2]][hExtVW] && pBackpackStored[playerid][0] == HouseInfo[PlayerInfo[playerid][pPhousekey2]][hSQLId]) )
        {
            
pBackpackStored[playerid][0] = 0;
            
GivePlayerBackpack(playeridpBackpackStored[playerid][1]);
            
pBackpackStored[playerid][1] = 0;

            new 
string[144];
            
format(stringsizeof(string), "{FF8000}* {C2A2DA}%s (%d) takes their backpack out of the house locker."PlayerNameEx(playerid), playerid);
            
SendNearbyMessage(10010playerid0xC2A2DAFFstring);
        }
        
SendClientMessage(playerid0xFF0000FF"You have not stored backpack in this house!");
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)