newcar id's problem
#1

Hello , I have an problem with newcar id's ! They go wild

I have :

Quote:

if(newcar == 152 || newcar == 153 || newcar == 154 || newcar == 155 || newcar == 156 || newcar == 157 || newcar == 158 ||newcar == 159 || newcar == 160 || newcar == 161 || newcar == 162)
{
if(PlayerInfo[playerid][pMember] == 6||PlayerInfo[playerid][pLeader] == 6) { }
else
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,COLOR_GREY,"{30a030}[GameFront]: {ffffff}Ne pare rau, dar nu faci parte din factiunea {30a030}Yakuza{ffffff}.");
RemovePlayerFromVehicle(playerid);
}
}

And tommorow newcar ==162 is an PD car , how i cand find these id's ?
Reply
#2

First of all, let's clean the code a little
pawn Код:
switch(newcar) {
    case 152..162: {
        if(!(PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6))
        {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid,COLOR_GREY,"{30a030}[GameFront]: {ffffff}Ne pare rau, dar nu faci parte din factiunea {30a030}Yakuza{ffffff}.");
            return 1;
        }
    }
}
You can find car id by looking at your code. Each CreateVehicle/AddStaticVehicle adds +1 to next car id. Pretty simple
Reply
#3

pawn Код:
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,COLOR_GREY,"{30a030}[GameFront]: {ffffff}Ne pare rau, dar nu faci parte din factiunea {30a030}Yakuza{ffffff}.");
RemovePlayerFromVehicle(playerid);
why you need to use 2 times of RemovePlayerFromVehicle ?
Reply
#4

Solved

Now i have another problem

If i'm pd (faction id 1) or fbi (faction id 2) and I use /duty it saying i'm not PD or F.B.I.

Quote:

if(strcmp(cmd, "/duty", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
if(PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pLeader] == 4)
{
if(JobDuty[playerid] == 1)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "» Din pacate acuma esti Off-Dury.");
JobDuty[playerid] = 0;
Medics -= 1;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "» Felicitari, ti-ai ridicat echipamentu si te-ai facut On-Duty.");
JobDuty[playerid] = 1;
Medics += 1;
}
}
else if(PlayerInfo[playerid][pJob] == 6)
{
if(JobDuty[playerid] == 1)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "» Din pacate esti Off-Duty de la Job-ul Car Mechanic.");
JobDuty[playerid] = 0;
Mechanics -= 1;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "» Felicitari, acuma esti On-Duty la Job-ul Car Mechanic.");
JobDuty[playerid] = 1;
Mechanics += 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "{30a030}[GameFront]: {ffffff}Ne pare rau, dar nu faci parte din factiunea {3c54fc}PD{ffffff} sau {3c54fc}FBI{ffffff}.");
}
}
return 1;
}

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)