SA-MP Forums Archive
Pawno two errors - 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: Pawno two errors (/showthread.php?tid=343387)



Pawno two errors - Yordan_Kronos - 17.05.2012

Код:
C:\Documents and Settings\Administrator\Desktop\gtaaaa\gamemodes\larp.pwn(6343) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrator\Desktop\gtaaaa\gamemodes\larp.pwn(6343) : error 001: expected token: ";", but found "if"
Код:
	SendAdminMessage(COLOR_GREEN, string2);
	}
	else if(reason == 1)
	{
		textreason = "Leaving";
Please help me.Thanks


Re: Pawno two errors - Ballu Miaa - 17.05.2012

Show us the proper code please and comment the line where you get the error/warning.


Re: Pawno two errors - Yordan_Kronos - 17.05.2012

Код:
{
	    new i = IsPlayerInEVehicle[playerid];
		Seats[i] --;
	}
	new string[24];
	new d,m,y,h,mi,s;
	getdate(y,m,d);
	gettime(h,mi,s);
	format(string, sizeof(string), "%d/%d/%d at %d:%d:%d",d,m,y,h,mi,s);
	strmid(PlayerInfo[playerid][pLastSeen], string, 0, strlen(string), 255);
	{
		textreason = "Crashed";
		strmid(PlayerInfo[playerid][pWhyLeft], "Crashed", 0, strlen("Crashed"), 255);
		format(string2, sizeof(string2),"[INFO]: %sВлезе/Излезе Излезна от Bulgarian Roleplay.[%s]",plname, textreason);
   		SendAdminMessage(COLOR_GREEN, string2);
	}
	else if(reason == 1)
	{
		textreason = "Leaving";
		strmid(PlayerInfo[playerid][pWhyLeft], "Leaving", 0, strlen("Leaving"), 255);
		format(string2, sizeof(string2),"[INFO]: %sВлезе/Излезе Излезна от Bulgarian Roleplay.[%s]",plname, textreason);
   		SendAdminMessage(COLOR_GREEN, string2);
	}
	else if(reason == 2)
	{
		strmid(PlayerInfo[playerid][pWhyLeft], "Kicked/Banned", 0, strlen("Kicked/Banned"), 255);
	}
	SaveGuns(playerid);
	OnPlayerUpdateEx(playerid);
	if(OfficerCourseStep[playerid] != 255)
	{
THIS IS THE LINE


Re: Pawno two errors - Ballu Miaa - 17.05.2012

This is the whole code bro. Im talking about only one line. CTRL + G in your game mode. Enter "6343" and copy , paste it here.


Re: Pawno two errors - Yordan_Kronos - 17.05.2012

Код:
	else if(reason == 1)



Re: Pawno two errors - Verbal - 17.05.2012

You can't set a sting into a variable just with "=". You have to use format.
And there's also an error that you forgot to put ";", so check where .


Re: Pawno two errors - Yordan_Kronos - 17.05.2012

how to become


Re: Pawno two errors - .FuneraL. - 17.05.2012

Change else if to "if"


Re: Pawno two errors - Yordan_Kronos - 17.05.2012

Working,Thanks Funeral + rep


Re: Pawno two errors - Ballu Miaa - 17.05.2012

Quote:
Originally Posted by Verbal
Посмотреть сообщение
You can't set a sting into a variable just with "=". You have to use format.
And there's also an error that you forgot to put ";", so check where .
Holy Fuck. Weed's killing my brain cells? I didnt see that. And i really dont think changing else if to if might compile but i think it will not work fine when you will run the server. You should use format function for a string.