2 language script help
#1

Why on this line have errors?

Код:
E:\SAMP Server\PittBull Stunt\gamemodes\pittbull.pwn(74) : error 028: invalid subscript (not an array or too many subscripts): "IgracInfo"
E:\SAMP Server\PittBull Stunt\gamemodes\pittbull.pwn(74) : warning 215: expression has no effect
E:\SAMP Server\PittBull Stunt\gamemodes\pittbull.pwn(74) : error 001: expected token: ";", but found "]"
E:\SAMP Server\PittBull Stunt\gamemodes\pittbull.pwn(74) : error 029: invalid expression, assumed zero
E:\SAMP Server\PittBull Stunt\gamemodes\pittbull.pwn(74) : fatal error 107: too many error messages on one line
Line 74: (line 74 is with red color)

Quote:

public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/rules", true) == 0)
{
if (IgracInfo[playerid][Jezik] == 1)
{
SendClientMessage(playerid, 0xAA3333AA, "===========================[ RULES ]======================================");
SendClientMessage(playerid, 0xAA3333AA, "OVDJE IDE TEXT AKO JE ODABRAO ENG.");
SendClientMessage(playerid, 0xAA3333AA, "Don cheat");
}
if (IgracInfo[playerid][Jezik] == 2)
{
SendClientMessage(playerid, 0xAA3333AA, "===========================[ PRAVILA ]======================================");
SendClientMessage(playerid, 0xAA3333AA, "OVDJE IDE TEXT AKO JE ODABRAO HRV.");
SendClientMessage(playerid, 0xAA3333AA, "Nemoj koristiti cheatove ili modove");
}
return 1;
}
return 0;
}

I'm have defining jezik and IgracInfo

[code=pawno]enum IgracInfo
{
Jezik
}[/code]
Reply
#2

change enum!

enum IgracInfo
{
Jezik
}

new Igrac[MAX_PLAYERS][IgracInfo];

and in if change IgracInfo[Jazik] to Igrac[playerid][Jezik];
:S
Reply
#3

Quote:
Originally Posted by [TLV
ReVo_ ]
change enum!

enum IgracInfo
{
Jezik
}

new Igrac[MAX_PLAYERS][IgracInfo];

and in if change IgracInfo[Jazik] to Igrac[playerid][Jezik];
:S
Please add there in my script:

Код:
#include <a_samp>

enum IgracInfo
{
	Jezik
}

new Igrac[MAX_PLAYERS][IgracInfo];

main()
{
	print(" PittBull Stunt/DM");
	print(" _________________");
	print("   By: mariomako");
	print(" ");
}

public OnGameModeInit()
{
	SetGameModeText("Stunt/DM");
	AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
	return 1;
}

public OnPlayerConnect(playerid)
{
  ShowPlayerDialog(playerid,5510,DIALOG_STYLE_LIST,"Odaberite svoj jezik [PICK YOUR LANGUAGE]","English\nCroatian","OK","/");
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	return 1;
}

public OnPlayerSpawn(playerid)
{
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	return 1;
}

public OnVehicleSpawn(vehicleid)
{
	return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
	return 1;
}

public OnPlayerText(playerid, text[])
{
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if(strcmp(cmdtext, "/rules", true) == 0)
	{
		if (IgracInfo[playerid][Jezik] == 1)
		{
			SendClientMessage(playerid, 0xAA3333AA, "===========================[ RULES ]======================================");
			SendClientMessage(playerid, 0xAA3333AA, "OVDJE IDE TEXT AKO JE ODABRAO ENG.");
			SendClientMessage(playerid, 0xAA3333AA, "Don cheat");
		}
		if (IgracInfo[playerid][Jezik] == 2)
		{
			SendClientMessage(playerid, 0xAA3333AA, "===========================[ PRAVILA ]======================================");
			SendClientMessage(playerid, 0xAA3333AA, "OVDJE IDE TEXT AKO JE ODABRAO HRV.");
			SendClientMessage(playerid, 0xAA3333AA, "Nemoj koristiti cheatove ili modove");
		}
		return 1;
	}
	return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
	return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
	return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
	return 1;
}

public OnRconCommand(cmd[])
{
	return 1;
}

public OnPlayerRequestSpawn(playerid)
{
	return 1;
}

public OnObjectMoved(objectid)
{
	return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
	return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
	return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
	return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
	return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
	return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
	return 1;
}

public OnPlayerExitedMenu(playerid)
{
	return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
	return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
	return 1;
}

public OnPlayerUpdate(playerid)
{
	return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
	return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
	return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
	return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
  if(dialogid == 5510 && response)
  {

    switch(listitem)
    {
      case 0:
      {
      IgracInfo[playerid][Jezik] =2; // Time se oznacuje engleski jezik
      SendClientMessage(playerid,0x00FFD2FF,"Your language is english");
      }
      case 1:
      {
      IgracInfo[playerid][Jezik] =1; // Time se oznacuje hrvatski jezik
      SendClientMessage(playerid,0x00FFD2FF,"Tvoj jezik je hrvatski");
      }
    }
  }
  return 0;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
	return 1;
}
Reply
#4

Use a Pvar due to there only being 1 value in the enum.
Reply
#5

Quote:
Originally Posted by [HiC
TheKiller ]
Use a Pvar due to there only being 1 value in the enum.
how to add in this script?
Код:
#include <a_samp>

enum IgracInfo
{
	Jezik
}

new Igrac[MAX_PLAYERS][IgracInfo];

main()
{
	print(" PittBull Stunt/DM");
	print(" _________________");
	print("   By: mariomako");
	print(" ");
}

public OnGameModeInit()
{
	SetGameModeText("Stunt/DM");
	AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
	return 1;
}

public OnPlayerConnect(playerid)
{
  ShowPlayerDialog(playerid,5510,DIALOG_STYLE_LIST,"Odaberite svoj jezik [PICK YOUR LANGUAGE]","English\nCroatian","OK","/");
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	return 1;
}

public OnPlayerSpawn(playerid)
{
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	return 1;
}

public OnVehicleSpawn(vehicleid)
{
	return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
	return 1;
}

public OnPlayerText(playerid, text[])
{
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if(strcmp(cmdtext, "/rules", true) == 0)
	{
		if (IgracInfo[playerid][Jezik] == 1)
		{
			SendClientMessage(playerid, 0xAA3333AA, "===========================[ RULES ]======================================");
			SendClientMessage(playerid, 0xAA3333AA, "OVDJE IDE TEXT AKO JE ODABRAO ENG.");
			SendClientMessage(playerid, 0xAA3333AA, "Don cheat");
		}
		if (IgracInfo[playerid][Jezik] == 2)
		{
			SendClientMessage(playerid, 0xAA3333AA, "===========================[ PRAVILA ]======================================");
			SendClientMessage(playerid, 0xAA3333AA, "OVDJE IDE TEXT AKO JE ODABRAO HRV.");
			SendClientMessage(playerid, 0xAA3333AA, "Nemoj koristiti cheatove ili modove");
		}
		return 1;
	}
	return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
	return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
	return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
	return 1;
}

public OnRconCommand(cmd[])
{
	return 1;
}

public OnPlayerRequestSpawn(playerid)
{
	return 1;
}

public OnObjectMoved(objectid)
{
	return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
	return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
	return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
	return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
	return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
	return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
	return 1;
}

public OnPlayerExitedMenu(playerid)
{
	return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
	return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
	return 1;
}

public OnPlayerUpdate(playerid)
{
	return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
	return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
	return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
	return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
  if(dialogid == 5510 && response)
  {

    switch(listitem)
    {
      case 0:
      {
      IgracInfo[playerid][Jezik] =2; // Time se oznacuje engleski jezik
      SendClientMessage(playerid,0x00FFD2FF,"Your language is english");
      }
      case 1:
      {
      IgracInfo[playerid][Jezik] =1; // Time se oznacuje hrvatski jezik
      SendClientMessage(playerid,0x00FFD2FF,"Tvoj jezik je hrvatski");
      }
    }
  }
  return 0;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
	return 1;
}
Reply
#6

You can't script + you don't know english. Why are you here? Go back to the Non-Engish topics.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)