07.08.2011, 16:37
Hi I have a little problem...
If I lock my vehicle a little bit later it will be unlocked. you are not sure if it is unlocked or if it is locked. when you go to the car and try to go into it you sometimes notice that its unlocked. then you try to lock it: Vehicle unlocked. What the fuck?! Then you try it again: Vehicle locked. And now it's really locked. I know this is hard to understand however... here is my code:
If I lock my vehicle a little bit later it will be unlocked. you are not sure if it is unlocked or if it is locked. when you go to the car and try to go into it you sometimes notice that its unlocked. then you try to lock it: Vehicle unlocked. What the fuck?! Then you try it again: Vehicle locked. And now it's really locked. I know this is hard to understand however... here is my code:
pawn Код:
else if (strcmp("/carlock", cmd, true, 10) == 0)
{
tmp = strtok(cmdtext, idx);
if(!tmp[0])
{
format(tmp, 128, "Verwendung: /carlock [0 - %d]", Max_Player_Cars-1);
SendClientMessage(playerid, COLOR_WHITE, tmp);
return true;
}
new i = strval(tmp);
if (Carlist[playerid][i][Typ]!=-1)
{
if (Carlist[playerid][i][Carid]!=-1)
{
if (Carlist[playerid][i][Lock]==0)
{
Carlist[playerid][i][Lock]=1;
SetVehicleParamsForAll(Carlist[playerid][i][Carid],0,1);
SetVehicleParamsForPlayer(Carlist[playerid][i][Carid],playerid,0,1);
SendClientMessage(playerid, COLOR_RED, "Vehicle locked");
}
else
{
Carlist[playerid][i][Lock]=0;
SetVehicleParamsForAll(Carlist[playerid][i][Carid],0,0);
SendClientMessage(playerid, COLOR_RED, "Vehicle unlocked");
}
}
else { SendClientMessage(playerid, COLOR_GREY, "Du besitzt zur Zeit kein Auto auf diesen Slot!"); }
}
else { SendClientMessage(playerid, COLOR_GREY, "Du besitzt kein Auto auf diesen Slot!"); }
return 1;
}