[Help] Very stranged problem .. -
Maor1122 - 01.11.2010
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:
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;
}
Re: [Help] Very stranged problem .. -
Bessensap - 01.11.2010
new carid = IsPlayerNearAVehicle(playerid,13.5);
thats the problem, if ur in the car, ur not near it
Re: [Help] Very stranged problem .. -
Maor1122 - 01.11.2010
I'll check it ..
Re: [Help] Very stranged problem .. -
Maor1122 - 01.11.2010
I fixed it to that:
PHP код:
if(!strcmp(cmd, "/c", true) || !strcmp(cmd, "/car", true))
{
if(IsPlayerConnected(playerid) && IsPlayerInAnyVehicle(playerid) == 1 || IsPlayerInAnyVehicle(playerid) == 0)
{
new x_v[256];
x_v = strtok(cmdtext, idx);
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))
{
new carid = IsPlayerNearAVehicle(playerid,13.5);
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;
}
But there problem not fixed ..
( sorry about the double-post)
Re: [Help] Very stranged problem .. -
Bessensap - 01.11.2010
pawn Код:
if(!strcmp(cmd, "/c", true) || !strcmp(cmd, "/car", true))
{
if(IsPlayerConnected(playerid)
{
new x_v[256];
x_v = strtok(cmdtext, idx);
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))
{
new carid;
carid = IsPlayerNearAVehicle(playerid,13.5);
if(IsPlayerInAnyVehicle(playerid)) carid = GetPlayerVehicleID(playerid);
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;
}
should work
Re: [Help] Very stranged problem .. -
Maor1122 - 01.11.2010
Still ...
If you didn't understood .
my problem is not the /c lock command .
When i'm outside of vehicle and i'm do /c or /car without any space .
It's told me the actions, if i'm inside of vehicle, its not told me even the actions ..
Re: [Help] Very stranged problem .. -
Bessensap - 01.11.2010
What's the problem you are getting? be exact please
Re: [Help] Very stranged problem .. -
Maor1122 - 01.11.2010
Look at my post the upstairs, i edited ..
Re: [Help] Very stranged problem .. -
WillyP - 01.11.2010
Please, don't use [PHP] tags..........
Re: [Help] Very stranged problem .. -
Maor1122 - 01.11.2010
I Using ****** Chrome, i don't know why, but i dosen't have pawn tags here ..
someone can help me to fix it ?
If you didn't understood .
my problem is not the /c lock command .
When i'm outside of vehicle and i'm do /c or /car without any space .
It's told me the actions, if i'm inside of vehicle, its not told me even the actions ..