Textdraw help
#2

PHP код:
new bool:pizzarobtdentry[MAX_PLAYERS char];//Creating a variable to store if the player is in the checkpoint or not.
//Your code
if(checkpointid == PizzaRob)
{
    
SendClientMessage(playeridGRIS"Type /robstore to this store.");
    
TextDrawShowForPlayer(playeridpizzabox);
    
TextDrawShowForPlayer(playeridpizza);
    
pizzarobtdentry{playerid} = true;//Setting the variable to true, because they are in the checkpoint.
}
    
public 
OnPlayerText(playerid,text[]){
    if(
pizzarobtdentry{playerid} == true)//If they are in the checkpoint, they can use the chat to respond to it.
    
{
        switch(
strval(text))//Switch through the number they type in.
        
{
            case 
1GivePlayerWeapon(playerid,22,50);//Give the player the weapon they typed the option for
            
case 2GivePlayerWeapon(playerid,30,50);
            case 
3GivePlayerWeapon(playerid,31,50);
        }
        
TextDrawHideForPlayer(playerid,pizzabox);//hide the textdraws
        
TextDrawHideForPlayer(playerid,pizza);
        
pizzarobtdentry{playerid} = false;//Set the variable to false
        
return 0;//return 0 so that the number they type will not display in the chat.
    
}
    return 
1;

Remember to reset the variable upon death, spawn, connect, etc to prevent players from using it without entering the checkpoint, after leaving the checkpoint, or other instances.
Reply


Messages In This Thread
Textdraw help - by STONEGOLD - 01.06.2015, 16:11
Re: Textdraw help - by Banana_Ghost - 01.06.2015, 16:24
Re: Textdraw help - by STONEGOLD - 01.06.2015, 16:39
Re: Textdraw help - by Banana_Ghost - 01.06.2015, 16:46
Re: Textdraw help - by STONEGOLD - 01.06.2015, 20:55
Re: Textdraw help - by Banana_Ghost - 02.06.2015, 22:08

Forum Jump:


Users browsing this thread: 1 Guest(s)