26.01.2011, 14:22
Hello i want when i locked my car and i go offline or die in my car, the doors automatic open
Here my script
Here my script
Код:
if(!strcmp(cmdtext,"/lock")) { new Float:VX,Float:VY,Float:VZ; for(new vehicleid=1;vehicleid<MAX_VEHICLES;vehicleid++) { GetVehiclePos(vehicleid,VX,VY,VZ); if(!IsPlayerInRangeOfPoint(playerid,2.5,VX,VY,VZ))continue; if(Lock[vehicleid] == 0) { Lock[vehicleid] = 1; SendClientMessage(playerid,COLOR_GREEN," Car closed."); break; } if(Lock[vehicleid] == 1) { Lock[vehicleid] = 0; SendClientMessage(playerid,COLOR_GREEN," Car open."); break; } } return 1; }
Код:
public OnPlayerExitVehicle(playerid, vehicleid) { if (Lock[vehicleid] == 1) { { Lock[vehicleid] = 0; SendClientMessage(playerid,COLOR_GREEN," Car open."); } } }