13.03.2013, 22:15
Just if this helps..
dcmd_lock(playerid,params[]) {
#pragma unused params
if(IsPlayerConnected(playerid,"lock")) {
if(IsPlayerInAnyVehicle(playerid)) {
for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i)) SetVehicleParamsForPlayer(GetPlayerVehicleID(playe rid),i,false,true);
new name[24]; VehicleLockData[GetPlayerVehicleID(playerid)] = true; GetPlayerName(playerid,name,24); SendClientMessage(playerid,yellow,"You have locked your car."); return 1;
} else return SendClientMessage(playerid,red,"ERROR: You must be in a vehicle to lock.");
} else return SendLevelErrorMessage(playerid,"lock");
}
dcmd_unlock(playerid,params[]) {
#pragma unused params
if(IsPlayerConnected(playerid,"unlock")) {
if(IsPlayerInAnyVehicle(playerid)) {
for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i)) SetVehicleParamsForPlayer(GetPlayerVehicleID(playe rid),i,false,false);
new name[24]; VehicleLockData[GetPlayerVehicleID(playerid)] = false; GetPlayerName(playerid,name,24); SendClientMessage(playerid,yellow,"You have unlocked your car."); return 1;
} else return SendClientMessage(playerid,red,"ERROR: You must be in a vehicle to unlock.");
} else return SendLevelErrorMessage(playerid,"unlock");
}
also I changed this at the top.
dcmd(lock,5,cmdtext);
dcmd(unlock,7,cmdtext);
dcmd_lock(playerid,params[]) {
#pragma unused params
if(IsPlayerConnected(playerid,"lock")) {
if(IsPlayerInAnyVehicle(playerid)) {
for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i)) SetVehicleParamsForPlayer(GetPlayerVehicleID(playe rid),i,false,true);
new name[24]; VehicleLockData[GetPlayerVehicleID(playerid)] = true; GetPlayerName(playerid,name,24); SendClientMessage(playerid,yellow,"You have locked your car."); return 1;
} else return SendClientMessage(playerid,red,"ERROR: You must be in a vehicle to lock.");
} else return SendLevelErrorMessage(playerid,"lock");
}
dcmd_unlock(playerid,params[]) {
#pragma unused params
if(IsPlayerConnected(playerid,"unlock")) {
if(IsPlayerInAnyVehicle(playerid)) {
for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i)) SetVehicleParamsForPlayer(GetPlayerVehicleID(playe rid),i,false,false);
new name[24]; VehicleLockData[GetPlayerVehicleID(playerid)] = false; GetPlayerName(playerid,name,24); SendClientMessage(playerid,yellow,"You have unlocked your car."); return 1;
} else return SendClientMessage(playerid,red,"ERROR: You must be in a vehicle to unlock.");
} else return SendLevelErrorMessage(playerid,"unlock");
}
also I changed this at the top.
dcmd(lock,5,cmdtext);
dcmd(unlock,7,cmdtext);