SA-MP Forums Archive
pls help with error messages - 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: pls help with error messages (/showthread.php?tid=560957)



pls help with error messages - lollypap54 - 31.01.2015

pls help guys, idk why errors here :/

Код:
new ArNaujas[MAX_PLAYERS], slapt[128];
Код:
if(dialogid==1){
		if(response){
			new file[128], name[128];
			GetPlayerName(pid, name, 128);
			format(file, 128, "%s.txt", name);
			dini_Create(file);
			format(slapt, 128, "%s", inputtext);
			ArNaujas[pid]=1;
			SendClientMessage(pid, -1, "");
			SendClientMessage(pid, -1, "");
			SendClientMessage(pid, -1, "");
			SendClientMessage(pid, -1, "");
			SendClientMessage(pid, -1, "");
			SendClientMessage(pid, -1, "");
			SendClientMessage(pid, -1, "");
			SendClientMessage(pid, -1, "");
			SendClientMessage(pid, -1, "");
			SendClientMessage(pid, -1, "");
			ShowPlayerDialog(pid, 10, DIALOG_STYLE_MSGBOX, "LYTIES PASIRINKIMAS", "{FFFFFF}Pasirinkite lytį apačioje !", "Vyras", "Moteris");}
		if(!response){
			Kick(pid);}
		return 1;}
Код:
if(dialogid==2){
		if(response){
			new name[vard], file[128];
			GetPlayerName(pid, name, sizeof(name));
			format(file, sizeof(file), "%s.txt", name);
			if(ArNaujas[pid]==1){ //367
				if(slapt==inputtext){
					dini_IntSet(file, "slaptazodis", slapt);}
				else{ Kick(pid), dini_Remove(file); }}
			else{
			if(CheckPass(file, inputtext)){
				SendClientMessage(pid, -1, "");
				SendClientMessage(pid, -1, "");
				SendClientMessage(pid, -1, "");
				SendClientMessage(pid, -1, "");
				SendClientMessage(pid, -1, "");
				SendClientMessage(pid, -1, "");
				SendClientMessage(pid, -1, "");
				SendClientMessage(pid, -1, "");
				SendClientMessage(pid, -1, "");
				SendClientMessage(pid, -1, "");
				TogglePlayerSpectating(pid, 0);
				SpawnPlayer(pid);
				SendClientMessage(pid, -1, "{CC6600}Sekmingai prisijungei į {009900}Feel-Action.lt {CC6600}serverį !");}
			if(!CheckPass(file, inputtext)){
				Kick(pid);}}
			return 1;}}
Error messages :
Код:
D:\PAWN\def SampSV 0.3z+rar\GM\pawno\include\server\connect2.inc(367) : error 033: array must be indexed (variable "slapt")
D:\PAWN\def SampSV 0.3z+rar\GM\pawno\include\server\connect2.inc(368) : error 035: argument type mismatch (argument 3)
#define pid playerid


Re: pls help with error messages - nezo2001 - 31.01.2015

So, We have to guess the lines ?
Edit: lol sorry i didn't see the comments
Edit 2:I think it must be like that
PHP код:
if(slapt[128]==inputtext



Re: pls help with error messages - lollypap54 - 31.01.2015

error 032: array index out of bounds then :/


Re: pls help with error messages - M4D - 31.01.2015

use Strcmp.
https://sampwiki.blast.hk/wiki/Strcmp


Re: pls help with error messages - CalvinC - 31.01.2015

pawn Код:
if(slapt==inputtext){
You shouldn't check stuff like that, use Strcmp to compare inputtext with something.
Example:
pawn Код:
if(!strcmp(inputtext, "slapt", true))
Haven't tested, but might work.


Re: pls help with error messages - lollypap54 - 31.01.2015

Thanks for help guys, everything is working now :]