17.06.2016, 13:18
Hi everyone, how to detect if the player is near the last entered vehicle?
this code is not working
this is the line where i get the warnings
this code is not working
pawn Код:
warning 213: tag mismatch
warning 202: number of arguments does not match definition
warning 202: number of arguments does not match definition
pawn Код:
GetVehicleBoot(vehicleid, x, y, z);
pawn Код:
if(strcmp(cmd, "/gettrash", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xE74C3CFF, "{FFFFFF}You can't use this command in a vehicle.");
new vehicleid = GetPVarInt(playerid, "LastVehicleID");
if(GetVehicleModel(vehicleid) != 408) return SendClientMessage(playerid, 0xE74C3CFF, "{FFFFFF}Your last vehicle has to be a Trashmaster.");
if(HasTrash[playerid]) return SendClientMessage(playerid, 0xE74C3CFF, "{FFFFFF}You're already carrying a trash bag.");
new id = Trash_Closest(playerid);
if(id == -1) return SendClientMessage(playerid, 0xE74C3CFF, "{FFFFFF}You're not near any trash.");
if(TrashData[id][TrashLevel] < 1) return SendClientMessage(playerid, 0xE74C3CFF, "{FFFFFF}There's nothing here.");
new Float: x, Float: y, Float: z;
GetVehicleBoot(vehicleid, x, y, z);
if(GetPlayerDistanceFromPoint(playerid, x, y, z) >= 30.0) return SendClientMessage(playerid, 0xE74C3CFF, "{FFFFFF}You're not near your Trashmaster.");
TrashData[id][TrashLevel]--;
KillTimer(TrashData[id][TrashTimer]);
TrashData[id][TrashTimer] = SetTimerEx("FillTrash", REFILL_TIME * 1000, false, "i", id);
TrashCP[playerid] = CreateDynamicCP(x, y, z, 3.0, .playerid = playerid);
HasTrash[playerid] = true;
ApplyAnimation(playerid, "CARRY", "liftup105", 4.1, 0, 0, 0, 0, 0);
SetPlayerAttachedObject(playerid, ATTACHMENT_INDEX, 1264, 6, 0.222, 0.024, 0.128, 1.90, -90.0, 0.0, 0.5,0.5, 0.5);
Streamer_SetIntData(STREAMER_TYPE_3D_TEXT_LABEL, TrashData[id][TrashLabel], E_STREAMER_COLOR, (TrashData[id][TrashLevel] == 0) ? 0xE74C3CFF : 0xF39C12FF);
SendClientMessage(playerid, 0x2ECC71FF, "{FFFFFF}You can press {F39C12}~k~~CONVERSATION_NO~ {FFFFFF}to remove the trash bag.");
}
return 1;
}