No removing underscore.
#1

Hello so I am confused as to why my GiveNameSpace is not removing the underscore. Thanks for the replys.







Код:
stock GetPlayerNameEx(playerid,ENameType:type) {
	new name[MAX_PLAYER_NAME+1];
	//SetPVarString(playerid,"CharUsername",id_string);
	if(IsPlayerConnected(playerid)) {
		switch(type) {
			case ENameType_AccountName: {
				GetPVarString(playerid,"AccountName",name,MAX_PLAYER_NAME);
			}
			case ENameType_RPName: {
				new maskid = GetPVarInt(playerid, "MaskID");
				if(GetPVarInt(playerid, "MaskOn") != 1) {				
					GetPVarString(playerid,"CharUsername",name,MAX_PLAYER_NAME);
				} else {
					format(name, sizeof(name), "Stranger_%d",maskid);
				}
				GiveNameSpace(name);
			}
			case ENameType_CharName: {
				GetPVarString(playerid,"CharUsername",name,MAX_PLAYER_NAME);
			}
			case ENameType_RPName_NoMask: {
				GetPVarString(playerid,"CharUsername",name,MAX_PLAYER_NAME);
				GiveNameSpace(name);
			}
			case ENameType_Phone_Name: {
				GetPVarString(playerid,"CharUsername",name,MAX_PLAYER_NAME);
				if(GetPVarInt(playerid, "PhoneStatus") == 1) {
					strmid(name,"Anonymous",0,9,MAX_PLAYER_NAME);
				}
				if(GetPVarInt(playerid, "PhoneStatus") == 3) {
					strmid(name,"Payphone",0,9,MAX_PLAYER_NAME);
				}
				GiveNameSpace(name);			
			}
		}
		if(strlen(name) < 1) { //null name(either not logged in or a bug happend to them
			GetPlayerName(playerid, name, sizeof(name));
		}
	} else {
		GetPlayerName(playerid, name, sizeof(name));
	}
	return name;
}
Код:
GiveNameSpace(str[])
{
    new strl;
    strl=strlen(str);
    while(strl--) {
    if(str[strl]=='_')	str[strl]=' ';
    }
    return 0;
}
Reply


Messages In This Thread
No removing underscore. - by Alex_T - 27.12.2015, 22:31
Re: No removing underscore. - by SickAttack - 27.12.2015, 22:33
Re: No removing underscore. - by Vince - 27.12.2015, 22:56
Re: No removing underscore. - by Alex_T - 28.12.2015, 17:10

Forum Jump:


Users browsing this thread: 1 Guest(s)