OnPlayerText
#1

Код:
C:\Users\Hash\Desktop\My Stuff\Server\gamemodes\NLRP.pwn(854) : warning 209: function "OnPlayerText" should return a value
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
SCRIPT

Код:
		else if((strcmp("LC", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("LC")))
			{
			    PlayerInfo[playerid][pNationality] = 4;
                ClearChatbox(playerid, 8);
                SendClientMessage(playerid, COLOR_GREEN, "-----------------------------------------------------------------------");
			    SendClientMessage(playerid, COLOR_GREY, "Nice, so you are from Liberty City.");
			    SendClientMessage(playerid, COLOR_GREEN, "-----------------------------------------------------------------------");
			    ClearChatbox(playerid, 2);
				RegistrationStep[playerid] = 0;
			    TutTime[playerid] = 1;
			    return 1;
				}
         }
	}
}
How can i fix this ?
Reply
#2

Not really sure but did you tryed return 0; ?
Reply
#3

try this:
else
if((strcmp("LC", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("LC")))
{
PlayerInfo[playerid][pNationality] = 4;
ClearChatbox(playerid, ;
SendClientMessage(playerid, COLOR_GREEN, "-----------------------------------------------------------------------");
SendClientMessage(playerid, COLOR_GREY, "Nice, so you are from Liberty City.");
SendClientMessage(playerid, COLOR_GREEN, "-----------------------------------------------------------------------");
ClearChatbox(playerid, 2);
RegistrationStep[playerid] = 0;
TutTime[playerid] = 1;
return 1;
}
}
}
}
Reply
#4

Just before the final } of your OnPlayerText add return 1; or return 0;, depending on your chat system.
Reply
#5

https://sampwiki.blast.hk/wiki/OnPlayerText

You didn't return a value, do return 0;
Reply
#6

Quote:
Originally Posted by FireCat
Посмотреть сообщение
try this:
else
if((strcmp("LC", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("LC")))
{
PlayerInfo[playerid][pNationality] = 4;
ClearChatbox(playerid, ;
SendClientMessage(playerid, COLOR_GREEN, "-----------------------------------------------------------------------");
SendClientMessage(playerid, COLOR_GREY, "Nice, so you are from Liberty City.");
SendClientMessage(playerid, COLOR_GREEN, "-----------------------------------------------------------------------");
ClearChatbox(playerid, 2);
RegistrationStep[playerid] = 0;
TutTime[playerid] = 1;
return 1;
}
}
}
}
did'nt work, but i solved it anyway it was

Код:
			else if((strcmp("LC", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("LC")))
			{
			    PlayerInfo[playerid][pNationality] = 4;
                ClearChatbox(playerid, 8);
                SendClientMessage(playerid, COLOR_GREEN, "-----------------------------------------------------------------------");
			    SendClientMessage(playerid, COLOR_GREY, "Nice, so you are from Liberty City.");
			    SendClientMessage(playerid, COLOR_GREEN, "-----------------------------------------------------------------------");
			    ClearChatbox(playerid, 2);
				RegistrationStep[playerid] = 0;
			    TutTime[playerid] = 1;
			    return 0;
				}
         }
	}
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)