PDA

View Full Version : Tag Mismatch Warning


HoangNam
30/09/2016, 01:08 PM
new vehicleid = (playerid, 5.0);
It cant add "Float"

Farzam
30/09/2016, 01:29 PM
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.

iLearner
30/09/2016, 01:30 PM
What are you trying to do... ?

HoangNam
01/10/2016, 03:33 AM
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.

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;
}

Jayse
01/10/2016, 04:45 AM
You have this:


new vehicleid = (playerid, 5.0);


Which doesn't really get your vehicle ID, so you have to replace it with this:


new vehicleid = GetPlayerVehicleID(playerid);


Fixed code:


CMD:bwear(playerid, params[])
{
if(GetPlayerBackpack(playerid) != BACKPACK_NULL) return SendClientMessage(playerid, 0xFF0000FF, "You already have a backpack.");

if(GetPlayerInterior(playerid) == 0)
{
new vehicleid = GetPlayerVehicleID(playerid);
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;
}