SA-MP Forums Archive
OnPlayerText please help - 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: OnPlayerText please help (/showthread.php?tid=468356)



OnPlayerText please help - AnonScripter - 07.10.2013

How to make a text that makes 2 things in the same range of point, depends on what textdraw is showing now

Example:

pawn Код:
public OnPlayerEnterDynamicCP(checkpointid)
{
    if(checkpointid == LV[/LIST]CityHall) //LVCityHall Textdraws---------------
    {
        it will show him a textdraw with options....
        1. skills
        2. lottory
    }
}

public OnPlayerText(playerid, text[])
{
    if(IsPlayerInRangeOfPoint(playerid,1.0,x,y,z)) //the range of point is the same of the CP (LVCityHall)
    {
        if(strval(text) == 1)
        {
            TextDrawHideForPlayer(playerid, Skills); //if he types number [1] ,,it will hide the main textdraws
            TextDrawShowForPlayer(playerid, SkillsOptions); // and will show another text draws for the SKILLS
            //1. Hitman
            //2. Con Artist
            //3. Rapist
            {
                if(strval(text) == 1)
                {
                    SetPlayerSkill(playerid, Hitman);
                }
            }
        }
    }
    return 1;
}
if the player types number 1, it will hide the main textdraws and show him another textdraw options, the problem is when he types number 1 again to choose the Hitman Skill, it will not choose the hitman skill but it will choose Skills again that its in the main textdraws.

So the number is working only for the main textdraws, somebody know how ??
i think i should add "return" or somthing, but please tell me the solution



Re: OnPlayerText please help - AnonScripter - 07.10.2013

help please


Re: OnPlayerText please help - xganyx - 08.10.2013

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(IsPlayerInRangeOfPoint(playerid,1.0,x,y,z)) //the range of point is the same of the CP (LVCityHall)
    {
        if(strlen(text) == 1)
        {
            TextDrawHideForPlayer(playerid, Skills); //if he types number [1] ,,it will hide the main textdraws
            TextDrawShowForPlayer(playerid, SkillsOptions); // and will show another text draws for the SKILLS
            //1. Hitman
            //2. Con Artist
            //3. Rapist
        }
    }
    return 1;
}



Re: OnPlayerText please help - AnonScripter - 08.10.2013

Quote:
Originally Posted by xganyx
Посмотреть сообщение
pawn Код:
public OnPlayerText(playerid, text[])
{
    if(IsPlayerInRangeOfPoint(playerid,1.0,x,y,z)) //the range of point is the same of the CP (LVCityHall)
    {
        if(strlen(text) == 1)
        {
            TextDrawHideForPlayer(playerid, Skills); //if he types number [1] ,,it will hide the main textdraws
            TextDrawShowForPlayer(playerid, SkillsOptions); // and will show another text draws for the SKILLS
            //1. Hitman
            //2. Con Artist
            //3. Rapist
        }
    }
    return 1;
}
i said help, not copy my code -____-