One line error. [help]
#1

can someone help me fix this

Код:
: error 001: expected token: ")", but found "["
: error 029: invalid expression, assumed zero
: warning 215: expression has no effect
: error 001: expected token: ";", but found "]"
: fatal error 107: too many error messages on one line
CODE here

Код:
	if(dialogid == SETSTATION1) {
  		if(response) {
  		    new arrayid = listitem;
  			if(IsPlayerInAnyVehicle(playerid)) {
				foreach(Player, i) if(GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid)) {
				PlayAudioStreamForPlayer(i, RadioDialogData[arrayid][0]);
				}
			}
			else if(GetPVarType(playerid, "pBoomBox"))
			{
				foreach(Player, i)
				{
					if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "pBoomBoxArea")))
					{
						PlayAudioStreamForPlayer(i, RadioDialogData[arrayid][0], GetPVarFloat(playerid, "pBoomBoxX"), GetPVarFloat(playerid, "pBoomBoxY"), GetPVarFloat(playerid, "pBoomBoxZ"), 30.0, 1);
					}
				}
				SetPVarString(playerid, "pBoomBoxStation", RadioDialogData[arrayid][0]);
			}
			else
			{
				PlayAudioStreamForPlayer(playerid, RadioDialogData[arrayid][0]);
				SetPVarInt(playerid, "MusicIRadio", 1);
			}
	        format(string, sizeof(string), "* %s changes the station to %s.",GetPlayerNameEx(playerid), RadioDialogData[arrayid][1]);
	    	format(stationidv[GetPlayerVehicleID(playerid)], 64, "%s", RadioDialogData[arrayid][0]);
	    	ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        }
      	else
	  	{
          if(stationidv[GetPlayerVehicleID(playerid)][0] != 0) {
          	format(string, sizeof(string), "* %s turns off the radio.",GetPlayerNameEx(playerid));
          	ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
		  	foreach(Player, i) {
		  		if(GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid)){
		  		StopAudioStreamForPlayer(i);
		  		stationidv[GetPlayerVehicleID(playerid)][0] = 0;
		  		}
		  	}
		  	if(!IsPlayerInAnyVehicle(playerid))
			{
				if(GetPVarType(playerid, "pBoomBox"))
				{
					SendClientMessage(playerid, COLOR_WHITE, "You have turned off the boom box.");
					foreach(Player, i) if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "pBoomBoxArea"))) StopAudioStreamForPlayer(i);
					DeletePVar(playerid, "pBoomBoxStation");
				}
				else
				{
					StopAudioStreamForPlayer(playerid);
				}
			}
		  }
      	}
       	return 0;
	}
This line

Код:
          if(stationidv[GetPlayerVehicleID(playerid)][0] != 0) {
Reply
#2

Considering you are on a godfather edited script, add the following line to your script.

Add:
pawn Код:
new stationidv[MAX_VEHICLES];
I suggest you to place this with your variables for you not to complicate any part of your script. Please report back with any more errors.
Reply
#3

try to use this:

pawn Код:
new vehicleid = GetPlayerVehicleID(playerid);
if(stationidv[vehicleid][0] != 0) {
Reply
#4

Quote:
Originally Posted by dr.lozer
Посмотреть сообщение
try to use this:

pawn Код:
new vehicleid = GetPlayerVehicleID(playerid);
if(stationidv[vehicleid][0] != 0) {
Your code doesn't make any sense.
Reply
#5

Quote:
Originally Posted by Skavanovski
Посмотреть сообщение
Considering you are on a godfather edited script, add the following line to your script.

Add:
pawn Код:
new stationidv[MAX_VEHICLES];
I suggest you to place this with your variables for you not to complicate any part of your script. Please report back with any more errors.
Quote:
Originally Posted by dr.lozer
Посмотреть сообщение
try to use this:

pawn Код:
new vehicleid = GetPlayerVehicleID(playerid);
if(stationidv[vehicleid][0] != 0) {
Getting same errors.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)