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



GetPlayerFirstName - Error - iMads - 16.03.2013

Код:
stock GetPlayerFirstName(playerid){
	new String[2][MAX_PLAYER_NAME];
	new pName[MAX_PLAYER_NAME];
	GetPlayerName(playerid,pName, MAX_PLAYER_NAME);
	split(pName, String, '_');
	return String[0];
}
Hi,

This code won't work, via SendClientMessage and such. Would like any of you smartheads out there to help me

Thanks in advance.


Re: GetPlayerFirstName - Error - Denying - 16.03.2013

Can I see the split stock? I'm pretty sure it's not a pawn function.


Re: GetPlayerFirstName - Error - iMads - 16.03.2013

Quote:
Originally Posted by Denying
Посмотреть сообщение
Can I see the split stock? I'm pretty sure it's not a pawn function.
Hahahahaha, how stupid can i be? Of course.... I forgot the split function in my script! Thanks for reminding me about that, case resolved.


Re: GetPlayerFirstName - Error - Denying - 16.03.2013

Quote:
Originally Posted by iMads
Посмотреть сообщение
Hahahahaha, how stupid can i be? Of course.... I forgot the split function in my script! Thanks for reminding me about that, case resolved.
Hah, no problem, even though I did not do much.
Glad I could accidently remind you of that.


Re: GetPlayerFirstName - Error - iMads - 16.03.2013

Hi again,

Although, something is wrong with my split code.

Код:
/*
	- STOCK FUNCTIONS
*/
stock split(const strsrc[], strdest[][], delimiter)
{
    new i, li;
    new aNum;
    new len;
    while(i <= strlen(strsrc))
    {
        if(strsrc[i] == delimiter || i == strlen(strsrc))
        {
            len = strmid(strdest[aNum], strsrc, li, i, 128);
            strdest[aNum][len] = 0;
            li = i+1;
            aNum++;
        }
        i++;
    }
    return 1;
}
I've gotten this error when compiling:
Код:
: error 025: function heading differs from prototype



Re: GetPlayerFirstName - Error - Patrick - 16.03.2013

i tried compiling this and show's no error when compiling. can you show us what line and code is it pointing at?


Re: GetPlayerFirstName - Error - iMads - 16.03.2013

Quote:
Originally Posted by pds2012
Посмотреть сообщение
i tried compiling this and show's no error when compiling. can you show us what line and code is it pointing at?
It's the split command i've told is the problem, if you read...


Re: GetPlayerFirstName - Error - Patrick - 16.03.2013

as i said i did able to compile you're stock without any errors... so you need to show us exactly the code where the line error pointing at.


Re: GetPlayerFirstName - Error - Denying - 16.03.2013

Same here, compiled without any problem/error.


Re: GetPlayerFirstName - Error - iMads - 16.03.2013

Hi Guys,

Okay, so i've figured out that there was a split command in mysql.inc aswell, that was causing the trobule, fixed it now.