02.10.2013, 19:46
Okay, i know that compiler will issue this warning if the code indentation is 'loose'.
Correct:
Bad:
But please tell me where is my mistake O.o ?
Correct:
pawn Код:
if(condition)
{
action();
result();
}
pawn Код:
if(condition)
{
action();
result();
}
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new ime[MAX_PLAYER_NAME];
RPIme(playerid, ime);
for(new i; i < sizeof(VInfo); i++)
{
if(VInfo[i][ownedvehicle] == vehicleid)
{
if(i == IgracevAuto1[playerid] || VInfo[i][hZakljucan] == 0)
{
return 1;
}
else
{
new Float:Poz[3];
GetPlayerPos(playerid, Poz[0], Poz[1], Poz[2]);
SetPlayerPos_H(playerid, Poz[0], Poz[1]+2, Poz[2]+0.5);
SCMF(playerid, GRAD2, "* Automobil zakljucan! Vlasnik: %s", VInfo[i][hVlasnik]);
return 1;
}
}
}
for(new i; i < sizeof(MInfo); i++)
{
if(vehicleid == MInfo[i][mownedvehicle])
{
if(!strcmp(MInfo[i][mVlasnik], ime) || i == IgracevMotor[playerid] || MInfo[i][mZakljucan] == 0)
{
return 1;
}
else
{
new Float:Poz[3];
GetPlayerPos(playerid, Poz[0], Poz[1], Poz[2]);
SetPlayerPos_H(playerid, Poz[0], Poz[1]+2, Poz[2]+0.5);
SCMF(playerid, GRAD2, "* Motor zakljucan! Vlasnik: %s", MInfo[i][mVlasnik]);
return 1;
}
}
}
for(new i; i < sizeof(BInfo); i++)
{
if(vehicleid == BInfo[i][bownedvehicle])
{
if(!strcmp(BInfo[i][bhVlasnik], ime) || i == IgracevaBicikla[playerid] || BInfo[i][bhZakljucan] == 0)
{
return 1;
}
else
{
new Float:Poz[3];
GetPlayerPos(playerid, Poz[0], Poz[1], Poz[2]);
SetPlayerPos_H(playerid, Poz[0], Poz[1]+2, Poz[2]+0.5);
SCMF(playerid, GRAD2, "* Bicikla zakljucana! Vlasnik: %s", BInfo[i][bhVlasnik]);
return 1;
}
}
}
for(new i; i < sizeof(PInfo); i++)
{
if(vehicleid == PInfo[i][pownedvehicle])
{
if(!strcmp(PInfo[i][phVlasnik], ime) || i == IgracevoPlovilo[playerid] || PInfo[i][phZakljucan] == 0)
{
return 1;
}
else
{
new Float:Poz[3];
GetPlayerPos(playerid, Poz[0], Poz[1], Poz[2]);
SetPlayerPos_H(playerid, Poz[0], Poz[1]+2, Poz[2]+0.5);
SCMF(playerid, GRAD2, "* Plovilo zakljcano! Vlasnik: %s", PInfo[i][phVlasnik]);
return 1;
}
}
}
for(new i; i < sizeof(LInfo); i++)
{
if(vehicleid == LInfo[i][lownedvehicle])
{
if(!strcmp(LInfo[i][lhVlasnik], ime) || i == IgracevaLetelica[playerid] || LInfo[i][lhZakljucan] == 0)
{
return 1;
}
else
{
new Float:Poz[3];
GetPlayerPos(playerid, Poz[0], Poz[1], Poz[2]);
SetPlayerPos_H(playerid, Poz[0], Poz[1]+2, Poz[2]+0.5);
SCMF(playerid, GRAD2, "* Letelica zakljucana! Vlasnik: %s", LInfo[i][lhVlasnik]);
return 1;
}
}
}
new Float:Poz[3];
GetPlayerPos(playerid, Poz[0], Poz[1], Poz[2]);
for(new i; i < 21; i++)
{
if(vehicleid == PD[i])
{
if(PI[playerid][Clan] != 1)
{
SetPlayerPos_H(playerid, Poz[0], Poz[1]+1.5, Poz[2]+0.5);
GameTextForPlayer(playerid, "~r~Vozilo zakljucano! ~b~PD", 5000, 5);
}
}
if(vehicleid == C11[i])
{
if(PI[playerid][Clan] != 2)
{
SetPlayerPos_H(playerid, Poz[0], Poz[1]+1.5, Poz[2]+0.5);
GameTextForPlayer(playerid, "~r~Vozilo zakljucano! ~b~C11", 5000, 5);
}
}
if(vehicleid == SWAT[i])
{
if(PI[playerid][Clan] != 3)
{
SetPlayerPos_H(playerid, Poz[0], Poz[1]+1.5, Poz[2]+0.5);
GameTextForPlayer(playerid, "~r~Vozilo zakljucano! ~b~SWAT", 5000, 5);
}
}
if(vehicleid == MD[i])
{
if(PI[playerid][Clan] != 4)
{
SetPlayerPos_H(playerid, Poz[0], Poz[1]+1.5, Poz[2]+0.5);
GameTextForPlayer(playerid, "~r~Vozilo zakljucano! ~r~~h~~h~MD", 5000, 5);
}
}
if(vehicleid == SCF[i])
{
if(PI[playerid][Clan] != 5)
{
SetPlayerPos_H(playerid, Poz[0], Poz[1]+1.5, Poz[2]+0.5);
GameTextForPlayer(playerid, "~r~Vozilo zakljucano! ~r~~h~SCF", 5000, 5);
}
}
if(vehicleid == WTM[i])
{
if(PI[playerid][Clan] != 6)
{
SetPlayerPos_H(playerid, Poz[0], Poz[1]+1.5, Poz[2]+0.5);
GameTextForPlayer(playerid, "~r~Vozilo zakljucano! ~l~WTM", 5000, 5);
}
}
if(vehicleid == Mayor[i])
{
if(PI[playerid][Clan] != 7)
{
SetPlayerPos_H(playerid, Poz[0], Poz[1]+1.5, Poz[2]+0.5);
GameTextForPlayer(playerid, "~r~Vozilo zakljucano! ~l~MAYOR", 5000, 5);
}
}
if(vehicleid == HA[i])
{
if(PI[playerid][Clan] != 8)
{
SetPlayerPos_H(playerid, Poz[0], Poz[1]+1.5, Poz[2]+0.5);
GameTextForPlayer(playerid, "~r~Vozilo zakljucano! ~l~LSCA", 5000, 5);
}
}
if(vehicleid == RNL[i])
{
if(PI[playerid][Clan] != 9)
{
SetPlayerPos_H(playerid, Poz[0], Poz[1]+1.5, Poz[2]+0.5);
GameTextForPlayer(playerid, "~r~Vozilo zakljucano! ~Y~RAS", 5000, 5);
}
}
if(vehicleid == TC[i])
{
if(PI[playerid][Posao] != POSAO_TAKSISTA)
{
SetPlayerPos_H(playerid, Poz[0], Poz[1]+1.5, Poz[2]+0.5);
GameTextForPlayer(playerid, "~r~Vozilo zakljucano! ~Y~~H~TAXI", 5000, 5);
}
}
if(vehicleid == GSF[i])
{
if(PI[playerid][Clan] != 11)
{
SetPlayerPos_H(playerid, Poz[0], Poz[1]+1.5, Poz[2]+0.5);
GameTextForPlayer(playerid, "~r~Vozilo zakljucano! ~G~GSF", 5000, 5);
}
}
if(vehicleid == LSB[i])
{
if(PI[playerid][Clan] != 12)
{
SetPlayerPos_H(playerid, Poz[0], Poz[1]+1.5, Poz[2]+0.5);
GameTextForPlayer(playerid, "~r~Vozilo zakljucano! ~B~~H~LSB", 5000, 5);
}
}
if(vehicleid == NGR[i])
{
if(PI[playerid][Clan] != 13)
{
SetPlayerPos_H(playerid, Poz[0], Poz[1]+1.5, Poz[2]+0.5);
GameTextForPlayer(playerid, "~r~Vozilo zakljucano! ~R~NGR", 5000, 5);
}
}
if(vehicleid == BMC[i])
{
if(PI[playerid][Clan] != 14)
{
SetPlayerPos_H(playerid, Poz[0], Poz[1]+1.5, Poz[2]+0.5);
GameTextForPlayer(playerid, "~r~Vozilo zakljucano! ~w~BMC", 5000, 5);
}
}
if(vehicleid == ICF[i])
{
if(PI[playerid][Clan] != 15)
{
SetPlayerPos_H(playerid, Poz[0], Poz[1]+1.5, Poz[2]+0.5);
GameTextForPlayer(playerid, "~r~Vozilo zakljucano! ~w~ICF", 5000, 5);
}
}
if(vehicleid == VLA[i])
{
if(PI[playerid][Clan] != 16)
{
SetPlayerPos_H(playerid, Poz[0], Poz[1]+1.5, Poz[2]+0.5);
GameTextForPlayer(playerid, "~r~Vozilo zakljucano! ~w~MBF", 5000, 5);
}
}
if(vehicleid == RM[i])
{
if(PI[playerid][Clan] != 17)
{
SetPlayerPos_H(playerid, Poz[0], Poz[1]+1.5, Poz[2]+0.5);
GameTextForPlayer(playerid, "~r~Vozilo zakljucano! ~w~RM", 5000, 5);
}
}
}
/* new Float:Poz[3];
GetPlayerPos(playerid, Poz[0], Poz[1], Poz[2]);
if(vehicleid >= PD[1] && vehicleid <= PD[20])
{
if(PI[playerid][Clan] != 1)
{
SetPlayerPos_H(playerid, Poz[0], Poz[1]+1.5, Poz[2]+0.5);
GameTextForPlayer(playerid, "~r~Vozilo zakljucano! ~b~PD", 5000, 5);
}
}
else if(vehicleid >= C11[1] && vehicleid <= C11[20])
{
if(PI[playerid][Clan] != 2)
{
SetPlayerPos_H(playerid, Poz[0], Poz[1]+1.5, Poz[2]+0.5);
GameTextForPlayer(playerid, "~r~Vozilo zakljucano! ~b~C11", 5000, 5);
}
}
else if(vehicleid >= SWAT[1] && vehicleid <= SWAT[20])
{
if(PI[playerid][Clan] != 3)
{
SetPlayerPos_H(playerid, Poz[0], Poz[1]+1.5, Poz[2]+0.5);
GameTextForPlayer(playerid, "~r~Vozilo zakljucano! ~b~SWAT", 5000, 5);
}
}
else if(vehicleid >= MD[1] && vehicleid <= MD[20])
{
if(PI[playerid][Clan] != 4)
{
SetPlayerPos_H(playerid, Poz[0], Poz[1]+1.5, Poz[2]+0.5);
GameTextForPlayer(playerid, "~r~Vozilo zakljucano! ~r~~h~~h~MD", 5000, 5);
}
}
else if(vehicleid >= SCF[1] && vehicleid <= SCF[20])
{
if(PI[playerid][Clan] != 5)
{
SetPlayerPos_H(playerid, Poz[0], Poz[1]+1.5, Poz[2]+0.5);
GameTextForPlayer(playerid, "~r~Vozilo zakljucano! ~r~~h~SCF", 5000, 5);
}
}
else if(vehicleid >= WTM[1] && vehicleid <= WTM[20])
{
if(PI[playerid][Clan] != 6)
{
SetPlayerPos_H(playerid, Poz[0], Poz[1]+1.5, Poz[2]+0.5);
GameTextForPlayer(playerid, "~r~Vozilo zakljucano! ~l~WTM", 5000, 5);
}
}
else if(vehicleid >= Mayor[1] && vehicleid <= Mayor[20])
{
if(PI[playerid][Clan] != 7)
{
SetPlayerPos_H(playerid, Poz[0], Poz[1]+1.5, Poz[2]+0.5);
GameTextForPlayer(playerid, "~r~Vozilo zakljucano! ~L~MAYOR", 5000, 5);
}
}
else if(vehicleid >= HA[1] && vehicleid <= HA[20])
{
if(PI[playerid][Clan] != 8)
{
SetPlayerPos_H(playerid, Poz[0], Poz[1]+1.5, Poz[2]+0.5);
GameTextForPlayer(playerid, "~r~Vozilo zakljucano! ~L~HA", 5000, 5);
}
}
else if(vehicleid >= RNL[1] && vehicleid <= RNL[20])
{
if(PI[playerid][Clan] != 9)
{
SetPlayerPos_H(playerid, Poz[0], Poz[1]+1.5, Poz[2]+0.5);
GameTextForPlayer(playerid, "~r~Vozilo zakljucano! ~Y~RNL", 5000, 5);
}
}
else if(vehicleid >= TC[1] && vehicleid <= TC[24])
{
if(PI[playerid][Clan] != 10)
{
SetPlayerPos_H(playerid, Poz[0], Poz[1]+1.5, Poz[2]+0.5);
GameTextForPlayer(playerid, "~r~Vozilo zakljucano! ~Y~~H~TAXI", 5000, 5);
}
}
else if(vehicleid >= GSF[1] && vehicleid <= GSF[20])
{
if(PI[playerid][Clan] != 11)
{
SetPlayerPos_H(playerid, Poz[0], Poz[1]+1.5, Poz[2]+0.5);
GameTextForPlayer(playerid, "~r~Vozilo zakljucano! ~G~GSF", 5000, 5);
}
}
else if(vehicleid >= LSB[1] && vehicleid <= LSB[20])
{
if(PI[playerid][Clan] != 12)
{
SetPlayerPos_H(playerid, Poz[0], Poz[1]+1.5, Poz[2]+0.5);
GameTextForPlayer(playerid, "~r~Vozilo zakljucano! ~b~~H~LSB", 5000, 5);
}
}
else if(vehicleid >= NGR[1] && vehicleid <= NGR[20])
{
if(PI[playerid][Clan] != 13)
{
SetPlayerPos_H(playerid, Poz[0], Poz[1]+1.5, Poz[2]+0.5);
GameTextForPlayer(playerid, "~r~Vozilo zakljucano! ~R~NGR", 5000, 5);
}
}
else { }*/
return 1;
}