now can i make an lock command? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: now can i make an lock command? (
/showthread.php?tid=142905)
now can i make an lock command? -
KennYthegod - 20.04.2010
hey sup??
i wanna make an /lockmycar command for the personal cars do any1 got an ideea or an command??
PLZPLZPLZ HELP!!
Re: now can i make an lock command? -
boelie - 20.04.2010
above Ongamemodeinit;
Код:
new VehicleLock[MAX_VEHICLES];
Under onplayercommand;
Код:
if(strcmp(cmdtext, "/lock", true) == 0)//shuts down the alarm
{
new veh;
veh = GetPlayerVehicleID(playerid);
VehicleLock[veh] = 1;
return 1;
}
Код:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
if(VehicleLock[vehicleid] == 1)
{
SetVehicleParamsForPlayer(vehicleid,forplayerid,0,1);
}
return 1;
}
Re: now can i make an lock command? -
Assyria - 20.04.2010
Or much shorter:
Код:
if (strcmp("/lock", cmdtext, true, 10) == 0)
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xAA0000AA,"You are not in vehicle!");
{
SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),playerid,0,1);
}
return 1;
}
Re: now can i make an lock command? -
boelie - 20.04.2010
Yes but you still need the onvehiclestreamedin part
Re: now can i make an lock command? -
RyDeR` - 20.04.2010
Quote:
Originally Posted by Assyria
Or much shorter:
Код:
if (strcmp("/lock", cmdtext, true, 10) == 0)
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xAA0000AA,"You are not in vehicle!");
{
SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),playerid,0,1);
}
return 1;
}
|
Even if you shouldn't need OnVehicleStreamedIn this will fail!