25.04.2012, 13:12
Some problem with the pickup.
[NEW:]
[ERROR:]
[LINE:]
[NEW:]
pawn Код:
new PetrolPickup[MAX_PLAYERS][2];
pawn Код:
error 033: array must be indexed (variable "PetrolPickup")
pawn Код:
if(PetrolPickup[playerid] == 1)
{
if (IsPlayerInAnyVehicle(playerid))
{
new carid = GetPlayerVehicleID(playerid);
new cash=(random(70-20)+20);
if(IsAPetrol(carid))
{
switch(PetrolPickup[playerid][0])
{
case 0:
{
SetPlayerCheckpoint(playerid, 2620.0769,-2225.8220,12.9515, 5.0);
if(JustStarted[playerid] != 0)
{
JustStarted[playerid] = 0;
}
}
case 1:
{
SetPlayerCheckpoint(playerid, 2280.8584,-42.8751,26.4231, 5.0);
if(JustStarted[playerid] != 0)
{
JustStarted[playerid] = 0;
}
}
case 2:
{
SetPlayerCheckpoint(playerid, 2620.0769,-2225.8220,12.9515, 5.0);
if(JustStarted[playerid] != 0)
{
JustStarted[playerid] = 0;
}
}
case 3:
{
SetPlayerCheckpoint(playerid, 2220.0339,-2226.5051,13.5469, 5.0);
if(JustStarted[playerid] != 0)
{
JustStarted[playerid] = 0;
}
}
case 4:
{
if(JustStarted[playerid] != 1)
{
PlayerInfo[playerid][pPayCheck] += cash * 5;
format(string, sizeof(string), "~w~Dodato na vas racun~n~~g~$%d",cash);
GameTextForPlayer(playerid, string, 5000, 1);
}
}
case 5:
{
DisablePlayerCheckpoint(playerid);
TogglePlayerControllable(playerid, 0);
GameTextForPlayer(playerid, "~w~Koristite /exit da napustite sisternu~n~~r~Bonus 500$", 5000, 1);
SafeGivePlayerMoney(playerid, 500);
}
}
PetrolPickup[playerid][0]++;
PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
}
}
return 1;
}