Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:lock(playerid, params[])
- {
- new str[128], id = GetNearestVehicle(playerid, 5.0);
- if(id != INVALID_VEHICLE_ID)
- {
- if(Vehicles[id][Locked] == 0)
- {
- SetVehicleParamsEx(id, Engine[id], Lights[id], alarm[id], 1, bonnet[id], boot[id], objective[id]);
- doors[id] = 1;
- format(str, sizeof(str), "* %s locked the car door.*", GetRoleplayName(playerid), str);
- SendLocalMessage(playerid, str, Range_Short, COLOR_RP, COLOR_RP);
- }
- if(Vehicles[id][Locked] == 1)
- {
- SetVehicleParamsEx(id, Engine[id], Lights[id], alarm[id], 1, bonnet[id], boot[id], objective[id]);
- doors[id] = 0;
- format(str, sizeof(str), "* %s unlocked the car door.*", GetRoleplayName(playerid), str);
- SendLocalMessage(playerid, str, Range_Short, COLOR_RP, COLOR_RP);
- }
- return 1;
- }
- id = InRangeOfHouse(playerid);
- if(id != 0)
- {
- if(Character[playerid][House] == id)
- {
- if(Houses[id][Locked] == 0)
- {
- format(str, sizeof(str), "* %s places the key in the door, locking it.*", GetRoleplayName(playerid), str);
- SendLocalMessage(playerid, str, Range_Short, COLOR_RP, COLOR_RP);
- Houses[id][Locked] = 1;
- MYSQL_Update_Interger(Houses[id][SQLID], "Houses", "Locked", 1);
- return 1;
- }
- else
- {
- format(str, sizeof(str), "* %s places the key in the door, unlocking it.*", GetRoleplayName(playerid), str);
- SendLocalMessage(playerid, str, Range_Short, COLOR_RP, COLOR_RP);
- Houses[id][Locked] = 0;
- MYSQL_Update_Interger(Houses[id][SQLID], "Houses", "Locked", 0);
- return 1;
- }
- }
- }
- id = InRangeOfBiz(playerid);
- if(id != 0)
- {
- if(Character[playerid][Business_1] == id || Character[playerid][Business_2] == id)
- {
- if(Business[id][Locked] == 0)
- {
- format(str, sizeof(str), "* %s places the key in the door, locking it.*", GetRoleplayName(playerid), str);
- SendLocalMessage(playerid, str, Range_Short, COLOR_RP, COLOR_RP);
- Business[id][Locked] = 1;
- MYSQL_Update_Interger(Houses[id][SQLID], "Business", "Locked", 1);
- return 1;
- }
- else
- {
- format(str, sizeof(str), "* %s places the key in the door, unlocking it.*", GetRoleplayName(playerid), str);
- SendLocalMessage(playerid, str, Range_Short, COLOR_RP, COLOR_RP);
- MYSQL_Update_Interger(Houses[id][SQLID], "Business", "Locked", 1);
- Business[id][Locked] = 0;
- return 1;
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement