08.06.2011, 17:25
ok, ja entendi onde acho e onde por, sу +1 como pфr o exemplo que eu dei
assim?
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if ((newkeys==KEY_CROUCH)&&(IsPlayerInAnyVehicle(playerid))&&(GetPlayerState(playerid) == PLAYER_STATE_DRIVER))
{
if (GetVehicleModel(GetPlayerVehicleID(playerid)) == 525)
{
SendClientMessage(playerid,COLOR_WHITE,"Tentando rebocar o carro!.");
new Float:pos[6];
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
new Found, vid;
while (vid < MAX_VEHICLES && !Found)
{
vid++;
GetVehiclePos(vid, pos[3], pos[4], pos[5]);
if (floatabs(pos[0]-pos[3]) < 7.0 && floatabs(pos[1]-pos[4]) < 7.0 && floatabs(pos[2]-pos[5]) < 7.0 && vid != GetPlayerVehicleID(playerid))
{
Found=1;
if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
DetachTrailerFromVehicle(GetPlayerVehicleID(playerid));
AttachTrailerToVehicle(vid,GetPlayerVehicleID(playerid));
SendClientMessage(playerid,COLOR_WHITE,"Carro Rebocado!");
}
}
if (!Found)
{
SendClientMessage(playerid,COLOR_GREY,"O carro nгo estб perto do guincho!.");
}
}
}
if(newkeys == KEY_JUMP)
{
SendClientMessage(playerid, COLOR_ROSA,"Vocк apertou a tecla proibida, por favor, Nгo aperte mais");
}