Help with code
#1

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) {
Reply
#2

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

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

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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)