GetPlayerFirstName - Error
#1

Код:
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.
Reply
#2

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

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.
Reply
#4

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.
Reply
#5

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
Reply
#6

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

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...
Reply
#8

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.
Reply
#9

Same here, compiled without any problem/error.
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)