Fix this please
#1

1First when we cmd /engine the guy still sitting and engine doest not stop until i leave vehicle when come back and sit on bike engine automatically starts
Quote:

if(!strcmp(cmd, "/engine", true))
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInAnyVehicle(playerid))
{
if(!engineOn[GetPlayerVehicleID(playerid)])
{
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return 1;
if(pveh == 510 || pveh == 462 || pveh == 481 || pveh == 509) return 1;
if(IsARentableCar(idcar))
{
if(HireCar[playerid] != idcar) return 1;
}
if(IsAHarvest(idcar)) return 1;
if(IsADrugHarvest(idcar)) return 1;
if(IsASweeper(idcar)) return 1;
if(IsASalesVehicle(idcar)) return 1;


if(CanTurnEngine[playerid] != idcar && CanTurnEngine[playerid] == 9999)
return SendClientMessage(playerid, COLOR_GREY,"* You cannot turn this car's engine!");

format(string, sizeof(string), "* %s spins a key and tries to start vehicle engine.", sendername);
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,CO LOR_CHAT5);
GameTextForPlayer(playerid, "~w~Starting vehicle engine...",3500,3);
gEngine[playerid] = 1;
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /engine",d,m,y,h,mi,s,sendername);
CommandLog(string);
return 1;
}
else if(engineOn[GetPlayerVehicleID(playerid)])
{
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return 1;
if(pveh == 510 || pveh == 462 || pveh == 481 || pveh == 509) return 1;
if(IsARentableCar(idcar))
{
if(HireCar[playerid] != idcar) return 1;
}
if(IsAHarvest(idcar)) return 1;
if(IsADrugHarvest(idcar)) return 1;
if(IsASweeper(idcar)) return 1;

if(CanTurnEngine[playerid] != idcar && CanTurnEngine[playerid] == 9999)
return SendClientMessage(playerid, COLOR_GREY,"* You cannot turn this car's engine!");

format(string, sizeof(string), "* %s spins a key and turns off the engine.", sendername);
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,CO LOR_CHAT5);
GameTextForPlayer(playerid, "~w~Engine Turned Off.",3500,3);
gEngine[playerid] = 0;
TogglePlayerControllable(playerid, 1);//// ath the dealship's in the game, you can go there and try to get a car, buy when you do /v it spawns you a car, but you can take it away, idk how you can buy it,can you fix it where they cant leave with the car, they have to buy it first?
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /engine",d,m,y,h,mi,s,sendername);
CommandLog(string);
return 1;
}
}
}
return 1;
}

2 cmd when we go in lspd lockup do /duty its works fine but when we want to /duty again to off duty my previous skin not works .
Quote:

if(strcmp(cmd, "/duty", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pWanted] == 1) return SendClientMessage(playerid, COLOR_GREY, "* Criminals can not go on duty!");
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pMember] == 3 || IsAFreecop(playerid))
{
if(PlayerInfo[playerid][pDBanned] == 1)
{
SendClientMessage(playerid, COLOR_GREY, "* You are Banned from Cop Duty!");
return 1;
}
if (IsPlayerInRangeOfPoint(playerid, 6,255.3,77.4,1003.6) || IsPlayerInRangeOfPoint(playerid, 6,223.6328,186.8251,1003.0313) || IsPlayerInRangeOfPoint(playerid, 6, 233.4989,123.6518,1003.218 || PlayerInfo[playerid][pLocal] != 255)
{
if(PlayerInfo[playerid][pDuty] == 0)
{
if(IsAFreecop(playerid))
{
format(string, sizeof(string), "* Voluntary Officer %s took a Badge and a Gun from his locker.", sendername);
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,CO LOR_CHAT5);
SafeResetPlayerWeapons(playerid);
SafeGivePlayerWeapon(playerid, 41, 150);
SafeGivePlayerWeapon(playerid, 24, 70);
SafeGivePlayerWeapon(playerid, 3, 0);
SetPlayerColor(playerid,0xa9c4e400);
PlayerInfo[playerid][pDuty] = 1;
PlayerInfo[playerid][pChar] = 71;
new factionskin = PlayerInfo[playerid][pChar];
SetPlayerSkin(playerid, factionskin);
SaveGuns(playerid);
return 1;
}
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
{
format(string, sizeof(string), "* Officer %s took a Badge and a Gun from his locker.", sendername);
SetPlayerSkin(playerid, 280);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
SendClientMessage(playerid, COLOR_WHITE, "Type /equip for equipments // Type /undercover to see UC Skins!");
}
else if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
{
format(string, sizeof(string), "* Agent %s took a Badge and a Gun from his locker.", sendername);
SetPlayerSkin(playerid, 165);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
SendClientMessage(playerid, COLOR_WHITE, "Type /equip, /agent and /undercover for equipments & Skins!");
}
else if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
{
format(string, sizeof(string), "* Soldier %s took a Badge and a Gun from his locker.", sendername);
SetPlayerSkin(playerid, 287);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
SendClientMessage(playerid, COLOR_WHITE, "Type /equip and /soldier for equipments & Skins!");
}
SendClientMessage(playerid, COLOR_WHITE,"* If you wish to use your tazer type /tazer");
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,CO LOR_CHAT5);
SafeResetPlayerWeapons(playerid);
SafeGivePlayerWeapon(playerid, 24, 70);
SafeGivePlayerWeapon(playerid, 3, 0);
PlayerInfo[playerid][pTazerBullets] = 20;
PlayerInfo[playerid][pDuty] = 1;
PlayerInfo[playerid][pChar] = 280;
SetPlayerToTeamColor(playerid);
new factionskin = PlayerInfo[playerid][pChar];
SetPlayerSkin(playerid, factionskin);
AttachWeaponCorrectly(playerid, 23);
}
else if(PlayerInfo[playerid][pDuty] == 1)
{
if(IsAFreecop(playerid))
{
format(string, sizeof(string), "* Voluntary Officer %s places his Badge and Gun in his locker.", sendername);
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,CO LOR_CHAT5);
SafeResetPlayerWeapons(playerid);
PlayerInfo[playerid][pDuty] = 0;
SetPlayerColor(playerid, TEAM_HIT_COLOR);
new originalskin = PlayerInfo[playerid][pModel];
SetPlayerSkin(playerid, originalskin);
PlayerInfo[playerid][pChar] = 0;
SetPlayerWeapons(playerid);
return 1;
}
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
{
OnSwatDuty[playerid] = 0;
format(string, sizeof(string), "* Officer %s places his Badge and Gun in his locker.", sendername);
}
else if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
{
OnTacticalDuty[playerid] = 0;
format(string, sizeof(string), "* Agent %s places his Badge and Gun in his locker.", sendername);
}
else if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
{
OnSpecialFDuty[playerid] = 0;
format(string, sizeof(string), "* Soldier %s places his Badge and Gun in his locker.", sendername);
}
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,CO LOR_CHAT5);
SafeResetPlayerWeapons(playerid);
SafeSetPlayerArmour(playerid, 0);
SafeGivePlayerWeapon(playerid, 41, 500);
PlayerInfo[playerid][pDuty] = 0;
PlayerInfo[playerid][pChar] = 0;
SetPlayerColor(playerid, TEAM_HIT_COLOR);
new originalskin = PlayerInfo[playerid][pModel];
SetPlayerSkin(playerid, originalskin);
AttachWeaponCorrectly(playerid, 99);
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "** You are not in a locker room !");
return 1;
}
}
else if(PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pLeader] == 4)
{
if(!IsPlayerInRangeOfPoint(playerid, 3.0, 1222.1793,-1246.3489,1287.8243))
{
SendClientMessage(playerid, COLOR_GRAD1, "You are not at the Medic Lockers!");
return 1;
}
if(JobDuty[playerid] == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "* You are now Off Duty from your Medic Job and will not receive calls anymore.");
JobDuty[playerid] = 0;
Medics -= 1;
SetPlayerColor(playerid, TEAM_HIT_COLOR);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "* You are now On Duty with your Medic Job and will receive calls from people in need.");
JobDuty[playerid] = 1;
Medics += 1;
SetPlayerColor(playerid, 0xFF828200);
}
}
else if(PlayerInfo[playerid][pMember] == 12||PlayerInfo[playerid][pLeader] == 12)
{
if(!IsPlayerInRangeOfPoint(playerid, 3.0, 2811.7837,-1167.3248,1025.5703))
{
SendClientMessage(playerid, COLOR_GRAD1, "You are not at the Firemen Lockers!");
return 1;
}
if(JobDuty[playerid] == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "* You are now Off Duty from your Firemen Job and will not receive calls anymore.");
JobDuty[playerid] = 0;
SetPlayerColor(playerid, TEAM_HIT_COLOR);
SafeResetPlayerWeapons(playerid);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "* You are now On Duty with your Firemen Job and will receive calls from people in need.");
JobDuty[playerid] = 1;
SetPlayerColor(playerid, 0xAA333300);
SafeGivePlayerWeapon(playerid, 42, 2500);
SafeGivePlayerWeapon(playerid, 6, 1);
}
}
else if(PlayerInfo[playerid][pJob] == 17)
{
if(JobDuty[playerid] == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "* You are now Off Duty from your Pizza Delivery Job and will not receive calls anymore.");
JobDuty[playerid] = 0;
PizzaBoys -= 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "* You are now On Duty with your Pizza Delivery Job and will receive calls from people in need.");
JobDuty[playerid] = 1;
PizzaBoys += 1;
GetPlayerName(playerid,sendername,sizeof(sendernam e));
format(string, sizeof(string), "[Advert] Well stacked pizza worker %s is now On Duty, /call 111 to order a pizza.", sendername);
OOCNews(0xFF7E00AA,string);
}
}
else if(PlayerInfo[playerid][pJob] == 7)
{
if(JobDuty[playerid] == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "* You are now Off Duty from your Car Mechanic Job and will not receive calls anymore.");
JobDuty[playerid] = 0;
Mechanics -= 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "* You are now On Duty with your Car Mechanic Job and will receive calls from people in need.");
JobDuty[playerid] = 1;
Mechanics += 1;
GetPlayerName(playerid,sendername,sizeof(sendernam e));
format(string, sizeof(string), "[Advert] Car mechanic %s is now On Duty, /call 555 to call a mechanic.", sendername);
OOCNews(0x2993EDAA,string);
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not a Cop !");
}

new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /duty",d,m,y,h,mi,s,sendername);
CommandLog(string);
}
return 1;
}


3 when i want to /findcar its not working i mean its not creating check point where my vehicle is not giving correct location.

Quote:

if(strcmp(cmd, "/findcar", true) == 0) // By CuervO_NegrO
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pPcarkey] == 9999)
{
SendClientMessage(playerid, COLOR_GREY, "You don't have a car");
return 1;
}
new carid = PlayerInfo[playerid][pPcarkey];
new Float:X, Float:Y, Float:Z;
new zone[MAX_ZONE_NAME];
GetVehicle2DZone(carid, zone, MAX_ZONE_NAME);
GetVehiclePos(carid, X,Y,Z);
if(Searching[playerid] == 0)
{
Searching[playerid] = 1;
SetPlayerMapIcon(playerid, 500 + playerid, X,Y,Z, 41, COLOR_YELLOW);
format(string, sizeof(string),"Your car is at %s, red marker has been set at the map. Type /foundit when you have found it.",zone);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
}
else
{
RemovePlayerMapIcon(playerid, carid+1);
SetPlayerMapIcon(playerid, 500 + playerid, X,Y,Z, 41, COLOR_YELLOW);
format(string, sizeof(string),"Your car is at %s, red marker has been set at the map. Type /foundit when you have found it.",zone);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
}
}
return 1;
}

if(strcmp(cmd, "/findcar2", true) == 0) // By CuervO_NegrO
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pPcarkey2] == 9999)
{
SendClientMessage(playerid, COLOR_GREY, "You don't have a 2nd car");
return 1;
}
new carid = PlayerInfo[playerid][pPcarkey2];
new Float:X, Float:Y, Float:Z;
new zone[MAX_ZONE_NAME];
GetVehicle2DZone(carid, zone, MAX_ZONE_NAME);
GetVehiclePos(carid, X,Y,Z);
if(Searching[playerid] == 0)
{
Searching[playerid] = 1;
SetPlayerMapIcon(playerid, 500 + playerid, X,Y,Z, 41, COLOR_YELLOW);
format(string, sizeof(string),"Your car is at %s, red marker has been set at the map. Type /foundit when you have found it.",zone);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
}
else
{
RemovePlayerMapIcon(playerid, carid+1);
SetPlayerMapIcon(playerid, 500 + playerid, X,Y,Z, 41, COLOR_YELLOW);
format(string, sizeof(string),"Your car is at %s, red marker has been set at the map. Type /foundit when you have found it.",zone);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
}
}
return 1;
}

if(strcmp(cmd, "/foundit", true) == 0) // By CuervO_NegrO
{
if(IsPlayerConnected(playerid))
{
if(Searching[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "You are not searching your car");
return 1;
}
RemovePlayerMapIcon(playerid, 500 + playerid);
Searching[playerid] = 0;
SendClientMessage(playerid, TEAM_GROVE_COLOR, "* Marker Removed. Type /findcar(2) to create a marker on the car if you loose it again.");
}
return 1;
}

Reply
#2

Use "[ pawn] [ /pawn]" code without " " and spaces
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)