Possible to disable ID 0?
#1

Hello again, I've encountered another issue. All my commands require RP names, without the '_'. So I created a custom GetPlayerNameEx(playerid), and a GetOtherPlayerNameEx(). But whenever it does a global text, whenever it is ID 0 who does it, GetOtherPlayerNameEx() shows the players name rather than the targets. But for ID 1 + they work.

So I was wondering, if their was a possible way of disabling ID 0? It would be much appreciated.
Reply
#2

The only way to do this is by adding a NPC.
Reply
#3

Yes, just connect a bot that always takes ID 0. However, if you do your functions properly, there should be no problems with ID 0. Click here for a tutorial on how to add NPC's.
Reply
#4

Well my target code is this:
Код:
stock GetOtherPlayerNameEx()
{
    new targetid;
	new targetname[MAX_PLAYER_NAME];
	GetPlayerName(targetid, targetname,sizeof(targetname));
	for(new i;i<strlen(targetname);i++)
	{
		if(targetname[i] == '_') targetname[i] = ' ';
	}
	return targetname;
}
Should I alter this or simply add a NPC?

And thanks for the quick replies guys.
Reply
#5

That function makes absolutely no sense. You initialize targetid, but never assign a value to it; it will always be 0. Get rid of that targetid declaration and put it in the function header.

pawn Код:
stock GetOtherPlayerNameEx(targetid)
Reply
#6

Well, I done that, same error. Only worse, certain commands it shows blank, the rest shows the wrong name.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)