SA-MP Forums Archive
Dialog, tags replace - 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: Dialog, tags replace (/showthread.php?tid=603116)



Dialog, tags replace - FinStar - 18.03.2016

Hello, I want to ask you, I have a dialogue, and it got the information about the players (location, etc ..) and I need to do to make the brand '' replaced the word "Unknown"



That's the tag ( ' ' ) replace (Unknown) knows someone how to do it?

There is original script from Scavenge & Survive (SouthclawJK)

https://raw.githubusercontent.com/So...er/country.pwn

I was inspired by this one

Код:
stock GetPlayerCountryDataAsString(playerid, output[], len = sizeof(output))
{
	if(!IsPlayerConnected(playerid))
		return 0;

	format(output, len, "\
		Hostname: '%s'\n\
		Code: '%s'\n\
		Country: '%s'\n\
		Region: '%s'\n\
		ISP: '%s'\n\
		Proxy: %s",
		PlayerCountryData[playerid][cntr_Hostname],
		PlayerCountryData[playerid][cntr_Code],
		PlayerCountryData[playerid][cntr_Country],
		PlayerCountryData[playerid][cntr_Region],
		PlayerCountryData[playerid][cntr_ISP],
		PlayerCountryData[playerid][cntr_Proxy] ? ("Yes") : ("No"));

	return 1;
}



Re: Dialog, tags replace - Virtual1ty - 18.03.2016

Try this.

PHP код:
stock GetPlayerCountryDataAsString(playeridoutput[], len sizeof(output))
{
    if(!
IsPlayerConnected(playerid))
        return 
0;

    
format(outputlen"\
        Hostname: '%s'\n\
        Code: '%s'\n\
        Country: '%s'\n\
        Region: '%s'\n\
        ISP: '%s'\n\
        Proxy: %s"
,
        (!
PlayerCountryData[playerid][cntr_Hostname]) ? ("Unknown") : PlayerCountryData[playerid][cntr_Hostname],
        (!
PlayerCountryData[playerid][cntr_Code]) ? ("Unknown") : PlayerCountryData[playerid][cntr_Code],
        (!
PlayerCountryData[playerid][cntr_Country]) ? ("Unknown") : PlayerCountryData[playerid][cntr_Country],
        (!
PlayerCountryData[playerid][cntr_Region]) ? ("Unknown") : PlayerCountryData[playerid][cntr_Region],
        (!
PlayerCountryData[playerid][cntr_ISP]) ? ("Unknown") : PlayerCountryData[playerid][cntr_ISP],
        
PlayerCountryData[playerid][cntr_Proxy] ? ("Yes") : ("No"));

    return 
1;




Re: Dialog, tags replace - FinStar - 19.03.2016

Without errors and warnings, but unfortunately Pawn Compiler stopped working(Windows Box): / I use the #include <checkex.pwn>

// But only your code


Re: Dialog, tags replace - FinStar - 19.03.2016

I use it as headers, which I put into the script #include <checkex.pwn> when I'm with checkex.pwn compiles and everything works fine, but when the code compiles together with checkex.pwn and Pawn Compiler stops working. someone do not know anyone advice how to do it?


Re: Dialog, tags replace - FinStar - 19.03.2016

Someone help ?