xstyle
Компетентный
Вырезал авторынок из RLS и вылез баг с /lock. Короче пишу /lock пишет UnLock и больше ничего не происходит. По сути в следующий раз он должен был написать Lock и закрыть кар. Вот 2 команды /lock. Одна из моего мода другая из RLS.
Из моего мода:
Из RLS:
Помогите пожалуйста сделать одну нормальную команду.
Из моего мода:
PHP:
else if(strcmp(cmd, "/lock", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pCars] != 0)
{
new carid = PlayerInfo[playerid][pCars];
//caridhouse[playerid] == carid
if(gCarLock[carid] == 0)
{
format(string,sizeof(string),"~r~Locked");
GameTextForPlayer(playerid, string, 5000, 6);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
gCarLock[carid] = 1;
LockCar(carid);
}
if(gCarLock[carid] == 1)
{
format(string,sizeof(string),"~g~Unlocked");
GameTextForPlayer(playerid, string, 5000, 6);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
gCarLock[carid] = 0;
UnLockCar(carid);
}
}
PHP:
if(strcmp(cmd, "/lockkk", true) == 0)
{
new carid;
// GetPlayerName(playerid, sendername, sizeof(sendername));
if (PlayerInfo[playerid][pCars] == 0)
{
if(caridhouse[playerid] == 0) return SendClientMessage(playerid, COLOR_GRAD1, " У Вас нет машины!");
}
// carid = PlayerInfo[playerid][pPhouseKey]+1;
if(caridhouse[playerid] != 299)
{
carid = caridhouse[playerid];
}
//new driver = gLastDriver[carid];
new lockstatus = gCarLock[caridhouse[carid]];
new Float:cx,Float:cy,Float:cz;
GetVehiclePos(carid, cx, cy, cz);
switch (lockstatus)
{
case 0:
{
if(PlayerToPoint(4.0, playerid, cx, cy, cz) )
{
if(caridhouse[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GRAD1, " У Вас нет машины!");
return 1;
}
if(caridhouse[playerid] == carid )
{
format(string,sizeof(string),"~r~Locked");
GameTextForPlayer(playerid, string, 5000, 6);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
gCarLock[caridhouse[playerid]] = 0;
LockCar(caridhouse[playerid]);
IsLocked[caridhouse[playerid]] = 1;
//lockstatus == 0;
}
}
}
case 1:
{
if(PlayerToPoint(4.0, playerid, cx, cy, cz) )
{
if(caridhouse[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GRAD1, "У Вас нет машины!");
return 1;
}
if(caridhouse[playerid] == carid )
{
format(string,sizeof(string),"~g~Unlocked");
GameTextForPlayer(playerid, string, 5000, 6);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
gCarLock[caridhouse[playerid]] = 1;
UnLockCar(caridhouse[playerid]);
IsLocked[caridhouse[playerid]] = 1;
//lockstatus == 1;
}
}
}
default:
{
SendClientMessage(playerid, COLOR_RED, "Ошибка!");
}
}
if(carid == 256)
{
SendClientMessage(playerid, COLOR_GRAD1, " Вы не имеете машины!");
}
return 1;
}
