01.11.2010, 19:46
Look, when i command that i build, when i'm outside of vehicle, it work's .
if i'm inside of vehicle, it isn't, please help me to fix it, there is the command:
if i'm inside of vehicle, it isn't, please help me to fix it, there is the command:
PHP код:
if(!strcmp(cmd, "/c", true) || !strcmp(cmd, "/car", true))
{
if(IsPlayerConnected(playerid))
{
new x_v[256];
x_v = strtok(cmdtext, idx);
new carid = IsPlayerNearAVehicle(playerid,13.5);
if(!strlen(x_v))
{
SendClientMessage(playerid, COLOR_ORANGE, "USE Way: (/C)ar [Action]");
SendClientMessage(playerid, COLOR_WHITE, "[Actions] Lock, (Wi)ndow, Engine, Find, Park");
SendClientMessage(playerid, COLOR_WHITE, "[Actions] (S)eat(B)elt, ASell, CSell, List");
return 1;
}
else if(!strcmp(x_v, "Lock",true))
{
if(!strcmp(GetPlayerNameEx(playerid), CarInfo[carid][cOwnerName], true))
{
if(CarInfo[carid][cLocked] == 1)
{
CarInfo[carid][cLocked] = 0;
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
gCarLock[carid] = false;
UnLockCar(carid);
GameTextForPlayer(playerid, "~g~Unlocked", 7000, 5);
SetVehicleParamsForPlayer(carid,playerid,0,0);
format(string, sizeof(string), "* %s unlocks his car", GetPlayerNameEx(playerid));
ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
}
else
{
CarInfo[carid][cLocked] = 1;
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
gCarLock[carid] = true;
UnLockCar(carid);
GameTextForPlayer(playerid, "~r~Locked", 7000, 5);
SetVehicleParamsForPlayer(carid,playerid,0,0);
format(string, sizeof(string), "* %s locks his car", GetPlayerNameEx(playerid));
ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
}
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_ORANGE, "USE Way: (/C)ar [Action]");
SendClientMessage(playerid, COLOR_WHITE, "[Actions] Lock, (Wi)ndow, Engine, Find, Park");
SendClientMessage(playerid, COLOR_WHITE, "[Actions] (S)eat(B)elt, ASell, CSell, List");
return 1;
}
}
return 1;
}