SA-MP Forums Archive
Need help with LSPD duty... CMD - 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 LSPD duty... CMD (/showthread.php?tid=314563)



Need help with LSPD duty... CMD - trapped1 - 30.01.2012

Код:
CMD:duty(playerid, params[]) {
	if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 1 && playerVariables[playerid][pGroup] != 0) {
			return SendClientMessage(playerid, COLOR_GREY, "You are not a cop.");
		}
		else {

			new
				string[128];

		    switch(playerVariables[playerid][pAdminDuty]) {
				case 0: {
				    playerVariables[playerid][pGroup]][gGroupType] == 1;
					GetPlayerHealth(playerid, playerVariables[playerid][pHealth]);
					GetPlayerArmour(playerid, playerVariables[playerid][pArmour]);
					SetPlayerName(playerid, playerVariables[playerid][pAdminName]);
					SetPlayerHealth(playerid, 500000.0);
					format(string, sizeof(string), "Notice: {FFFFFF}Officer %s (%s) is now on LAPD duty.", playerVariables[playerid][pAdminName], playerVariables[playerid][pNormalName]);
				}
				case 1: {
				    playerVariables[playerid][pGroup] != 0;
					SetPlayerName(playerid, playerVariables[playerid][pNormalName]);
					SetPlayerHealth(playerid, playerVariables[playerid][pHealth]);
					SetPlayerArmour(playerid, playerVariables[playerid][pArmour]);
					format(string, sizeof(string), "Notice: {FFFFFF}Officer %s (%s) is now off LAPD duty.", playerVariables[playerid][pAdminName], playerVariables[playerid][pNormalName]);
				}
			}
			submitToAdmins(string, COLOR_HOTORANGE);
		}
	}
	return 1;
}
Код:
warning 215: expression has no effect
error 001: expected token: ";", but found "]"
error 029: invalid expression, assumed zero
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
So I have this cmd (made by admin cmd) But something is not working properly and 1 error I don't know how to fix it.. + rep if you help me!


Re: Need help with LSPD duty... CMD - trapped1 - 30.01.2012

Someone?


Re: Need help with LSPD duty... CMD - Dokins - 30.01.2012

Where are the lines of error?


Re: Need help with LSPD duty... CMD - trapped1 - 30.01.2012

Quote:

if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 1 && playerVariables[playerid][pGroup] != 0) {

This one sorry failed


Re: Need help with LSPD duty... CMD - Mosslah - 30.01.2012

pawn Код:
if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 1 || (groupVariables[playerVariables[playerid][pGroup]][gGroupType] != 0) {
Not sure if that will work if that's where you're getting the error.


Re: Need help with LSPD duty... CMD - trapped1 - 30.01.2012

Quote:

playerVariables[playerid][pGroup][gGroupType] == 1

Ohh I failed