SA-MP Forums Archive
Need help with cmd + rep - 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: Need help with cmd + rep (/showthread.php?tid=315973)



Need help with cmd + rep - trapped1 - 05.02.2012

Код:
error 029: invalid expression, assumed zero
Код:
CMD:duty(playerid, params[]) {
	if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 1 && playerVariables[playerid][pGroupRank] >= 4)
	{
		else{ 
		new
		string[128];
		switch(playerVariables[playerid][pLSPDDUTY])
		{
				case 0:
				{
 					playerVariables[playerid][pLSPDDUTY] = 1;
					GetPlayerHealth(playerid, playerVariables[playerid][pHealth]);
					GetPlayerArmour(playerid, playerVariables[playerid][pArmour]);
					SetPlayerName(playerid, playerVariables[playerid][pNormalName]);
					SetPlayerHealth(playerid, 100.0);
					format(string, sizeof(string), "Notice: {FFFFFF}Officer %s (%s) is now on Los Angelos Police duty.", playerVariables[playerid][pAdminName], playerVariables[playerid][pNormalName]);
				}
				case 1:
				{
	 	   			playerVariables[playerid][pLSPDDUTY] = 0;
					SetPlayerName(playerid, playerVariables[playerid][pNormalName]);
					SetPlayerHealth(playerid, playerVariables[playerid][pHealth]);
					SetPlayerArmour(playerid, playerVariables[playerid][pArmour]);
					format(string, sizeof(string), "Notice: {FFFFFF}Admin %s (%s) is now off Los Angelos Police duty.", playerVariables[playerid][pAdminName], playerVariables[playerid][pNormalName]);
 				}
			}
		}
	}
	return 1;
}
For helping me I will reward every one with + rep


Re: Need help with cmd + rep - trapped1 - 05.02.2012

Quote:

else{//this line

Sorry for double post net lagged..


Re: Need help with cmd + rep - Psymetrix - 05.02.2012

You have "else" on line 4. Remove it.

Edit: Too slow. Didn't the old forum warn you when a post had been made before you posted yours?