SA-MP Forums Archive
Help with code - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help with code (/showthread.php?tid=88908)



Help with code - Fukara_GM - 29.07.2009

Hi, I have this code. Is that is wrong or true. Plz reply
Код:
  if(ulasti < 10) {
  	if(currClass[playerid] == 0)
  {
	  ulasti++;
	  new string[256];
	  new pName[MAX_PLAYER_NAME];
	  GetPlayerName(playerid, pName, sizeof(pName));
	  format(string, sizeof(string), "%s area 51'e başarıyla giriş yaptı. %d/10", pName, ulasti);
	  SendClientMessage(playerid,COLOR_PURPLE, string);
	  DisablePlayerCheckpoint(playerid);
  }
  else if(currClass[playerid] == 1)
  {
	  ulasti++;
	  new string[256];
	  new pName[MAX_PLAYER_NAME];
	  GetPlayerName(playerid, pName, sizeof(pName));
	  format(string, sizeof(string), "%s area 51'e başarıyla giriş yaptı. %d/10", pName, ulasti);
	  SendClientMessage(playerid,COLOR_BLUE, string);
	  DisablePlayerCheckpoint(playerid);
  }
  else if(currClass[playerid] == 2)
  {
	  ulasti++;
	  new string[256];
	  new pName[MAX_PLAYER_NAME];
	  GetPlayerName(playerid, pName, sizeof(pName));
	  format(string, sizeof(string), "%s area 51'e başarıyla giriş yaptı. %d/10", pName, ulasti);
	  SendClientMessage(playerid,COLOR_BLUE, string);
	  DisablePlayerCheckpoint(playerid);
  }
  }
  else if(ulasti = 9) {
  	ulasti++;
	  new string[256];
	  new pName[MAX_PLAYER_NAME];
	  GetPlayerName(playerid, pName, sizeof(pName));
	  format(string, sizeof(string), "%s area 51'e başarıyla giriş yaptı ve round bitti. %d/10", pName, ulasti);
	  SendClientMessage(playerid,COLOR_PURPLE, string);
	  DisablePlayerCheckpoint(playerid);
  }
}
And one warning

Код:
D:\Rockstar Games\Samp Server\gamemodes\teamwartr.pwn(474) : warning 211: possibly unintended assignment
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Line 474

Код:
else if(ulasti = 9) {



Re: Help with code - afei - 29.07.2009

Код:
else if(ulasti = 9) {
Just use two "=".

Код:
else if(ulasti == 9) {
== means 'is the same as'


Re: Help with code - Fukara_GM - 29.07.2009

Quote:
Originally Posted by ChaNce'
Код:
else if(ulasti = 9) {
Just use two "=".

Код:
else if(ulasti == 9) {
== means 'is the same as'
wow thx for that