30.09.2016, 13:08
Код:
new vehicleid = (playerid, 5.0);
new vehicleid = (playerid, 5.0);
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. |
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; }
new vehicleid = (playerid, 5.0);
new vehicleid = GetPlayerVehicleID(playerid);
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;
}