19.05.2011, 20:37
Assim os carros da minha casa nao querem destrancar alguem pode me ajudar ta aqui o codi do /trancar:
pawn Код:
if(strcmp(cmd, "/trancar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new carid;
if (gTeam[playerid] == 2 || gTeam[playerid] == 1)
{
if(gLastCar[playerid] == 0 && PlayerInfo[playerid][pPHousekey] == 255)
{
SendClientMessage(playerid, COLOR_GRAD2, "Vocк nгo tem um carro.");
return 1;
}
else if(gLastCar[playerid] != 0 && gLastCar[playerid] != PlayerInfo[playerid][pPHousekey]+totalveiculos)
{
if (HireCar[playerid] != gLastCar[playerid] && HireCar[playerid] > 0)
{
gLastDriver[HireCar[playerid]] = 300;
gCarLock[HireCar[playerid]] = 0;
DesTrancarVeiculo(HireCar[playerid]);
}
HireCar[playerid] = gLastCar[playerid];
}
}
if (PlayerInfo[playerid][pPHousekey] == 255)
{
if(HireCar[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GRAD2, "Voce nгo tem um carro.");
return 1;
}
}
carid = PlayerInfo[playerid][pPHousekey]+totalveiculosh;
if(HireCar[playerid] > 0 && !SwitchKey[playerid])
{
carid = HireCar[playerid];
}
//new driver = gLastDriver[carid];
new lockstatus = gCarLock[carid];
new Float:cx,Float:cy,Float:cz;
GetVehiclePos(carid, cx, cy, cz);
switch (lockstatus)
{
case 0:
{
if(HireCar[playerid] == 0 && PlayerInfo[playerid][pPHousekey] == 255)
{
SendClientMessage(playerid, COLOR_GRAD2, "Vocк nгo tem um carro");
return 1;
}
if(HireCar[playerid] == carid && !SwitchKey[playerid])
{
format(string, sizeof(string), "~w~Veiculo~n~~r~Fechado");
GameTextForPlayer(playerid, string, 10000, 3);
SendClientMessage(playerid, 0xFF0000FF, "Vocк trancou o ъltimo veнculo que vocк usou / veнculo da casa / veнculo alugado.");
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
gCarLock[carid] = 1;
TrancarVeiculo(carid);
}
else if(PlayerInfo[playerid][pPHouseCarkey] == carid)
{
format(string, sizeof(string), "~w~Veiculo~n~~r~Fechado");
GameTextForPlayer(playerid, string, 10000, 3);
SendClientMessage(playerid, 0xFF0000FF, "Vocк trancou o ъltimo veнculo que vocк usou / veнculo da casa / veнculo alugado.");
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
gCarLock[carid] = 1;
TrancarVeiculo(carid);
return 1;
}
}
case 1:
{
if(HireCar[playerid] == 0 && PlayerInfo[playerid][pPHousekey] == 255)
{
SendClientMessage(playerid, COLOR_GRAD2, "Vocк nгo tem um carro");
return 1;
}
if(HireCar[playerid] == carid && !SwitchKey[playerid])
{
format(string, sizeof(string), "~w~Veiculo~n~~g~Aberto");
GameTextForPlayer(playerid, string, 10000, 3);
SendClientMessage(playerid, 0x00FF00FF, "Vocк abriu o ъltimo veнculo que vocк usou / veнculo da casa / veнculo alugado.");
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
gCarLock[carid] = 0;
DesTrancarVeiculo(carid);
}
if (PlayerInfo[playerid][pPHouseCarkey] == carid)
{
format(string, sizeof(string), "~w~Veiculo~n~~g~Aberto");
GameTextForPlayer(playerid, string, 10000, 3);
SendClientMessage(playerid, 0x00FF00FF, "Vocк abriu o ъltimo veнculo que vocк usou / veнculo da casa / veнculo alugado.");
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
gCarLock[carid] = 0;
DesTrancarVeiculo(carid);
return 1;
}
}
default:
{
SendClientMessage(playerid, COLOR_GRAD2, "Erro");
}
}
if(carid == 256)
{
SendClientMessage(playerid, COLOR_GRAD2, "Voce nгo tem um carro!");
}
}
return 1;
}