SA-MP Forums Archive
OnPlayerText - 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: OnPlayerText (/showthread.php?tid=163459)



OnPlayerText - Hash [NL-RP] - 27.07.2010

Код:
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 ?


Re: OnPlayerText - matthewdriftking - 27.07.2010

Not really sure but did you tryed return 0; ?


Re: OnPlayerText - FireCat - 27.07.2010

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;
}
}
}
}


Re: OnPlayerText - Vince - 27.07.2010

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


Re: OnPlayerText - rbN. - 27.07.2010

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

You didn't return a value, do return 0;


Re: OnPlayerText - Hash [NL-RP] - 27.07.2010

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;
}