SA-MP Forums Archive
What i do wrong ?? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: What i do wrong ?? (/showthread.php?tid=480373)



What i do wrong ?? - dakata994 - 10.12.2013

SLOVED!!! Thanks to all.


Respuesta: What i do wrong ?? - ghost556 - 10.12.2013

Which line is 647?


Re: What i do wrong ?? - dakata994 - 10.12.2013

EDIT: wrong its this
Код:
else if(vehicleid == BallasCar[i])



Respuesta: What i do wrong ?? - ghost556 - 10.12.2013

Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    for(new i = 0; i < 12; i++)
    {
    	if(vehicleid == GroveCar[i])
        {
            if(PlayerInfo[playerid][pGrove] < 1)
            {
                ClearAnimations(playerid);
                SendClientMessage(playerid, COLOR_GREEN, "[Grove] You need to be in the Grove Gang to drive Grove Cars!");
        }
	}
 	else if(vehicleid == BallasCar[i])
        {
            if(PlayerInfo[playerid][pBallas] < 1)
            {
                ClearAnimations(playerid);
                SendClientMessage(playerid, COLOR_PINK, "[Ballas] You need to be in the Ballas Gang to drive Ballas Cars!");
            }
            }
           }
            return 1;
        }
Try that


Re: What i do wrong ?? - Emmet_ - 10.12.2013

Here:

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    for (new i = 0; i < 12; i ++) if (vehicleid == GroveCar[i])
    {
        if (PlayerInfo[playerid][pGrove] < 1)
        {
            ClearAnimations(playerid);
            SendClientMessage(playerid, COLOR_GREEN, "[Grove] You need to be in the Grove Gang to drive Grove Cars!");
            break;
        }
    }
    for (new i = 0; i < 12; i ++) if (vehicleid == BallasCar[i])
    {
        if (PlayerInfo[playerid][pBallas] < 1)
        {
            ClearAnimations(playerid);
            SendClientMessage(playerid, COLOR_PINK, "[Ballas] You need to be in the Ballas Gang to drive Ballas Cars!");
            break;
        }
    }
    return 1;

}
It's vital to have proper indentation as it makes more readable code.


Re: What i do wrong ?? - dakata994 - 10.12.2013

Thanks to all I Fixed it.