Ayuda Expertos SSCANF (Scripters)
#6

Muchas gracias por la respuesta de todos.

dejo el cуdigo completo.

PHP код:
YCMD:get(playeridparams[], help)
{
    if(
help) return SCM(playeridCOLOR_GREY"Not supported");
    if(
IsPlayerConnected(playerid))
    {
        new 
x_job[128], string[256];
        if(
sscanf(params"s[128]"x_job))
        {
            
SCM(playeridCOLOR_WHITE"|__________________ Get __________________|");
            
SCM(playeridCOLOR_WHITE"USAGE: /get [name]");
            
SCM(playeridCOLOR_GREY"Available names: Drugs, Fuel");
            
SCM(playeridCOLOR_GREEN"|_________________________________________|");
            return 
1;
        }
        if(
strcmp(x_job,"drugs",true) == 0)
        {
            if(
PlayerInfo[playerid][pDrugs] > 15)
            {
                
format(stringsizeof(string), "** You still have %d grams with you, sell them first !"PlayerInfo[playerid][pDrugs]);
                
SCM(playeridCOLOR_GREYstring);
                return 
1;
            }
            new 
tel;
            new 
price;
            new 
ammount;
            new 
level PlayerInfo[playerid][pDrugsSkill];
            if(
sscanf(params"d"ammount))
            {
                
SCM(playeridCOLOR_GRAD2"USAGE: /get drugs [ammount]");
                return 
1;
            }
            if(
level >= && level <= 50)
            { 
tel 200; if(ammount || ammount 6) { SCM(playeridCOLOR_GREY"** You cant go below 1 or above 6 at your Skill Level!"); return 1; } }
            else if(
level >= 51 && level <= 100)
            { 
tel 150; if(ammount || ammount 12) { SCM(playeridCOLOR_GREY"**  You cant go below 1 or above 12 at your Skill Level!"); return 1; } }
            else if(
level >= 101 && level <= 200)
            { 
tel 100; if(ammount || ammount 20) { SCM(playeridCOLOR_GREY"** You cant go below 1 or above 20 at your Skill Level!"); return 1; } }
            else if(
level >= 201 && level <= 400)
            { 
tel 50; if(ammount || ammount 30) { SCM(playeridCOLOR_GREY"**  You cant go below 1 or above 30 at your Skill Level!"); return 1; } }
            else if(
level >= 401)
            { 
tel 10; if(ammount || ammount 99) { SCM(playeridCOLOR_GREY,"**   You cant go below 1 or above 99 at your Skill Level!"); return 1; } }
            if (
PlayerInfo[playerid][pJob] == && IsPlayerInRangeOfPoint(playerid2523.6057,-1812.9794,6.5713) || IsPlayerInRangeOfPoint(playerid21424.1729,-1317.9955,13.5547))
            {
                
price ammount tel;
                if(
GetPlayerMoney(playerid) > price)
                {
                    
format(stringsizeof(string), "* You bought %d grams for $%d."ammountprice);
                    
SCM(playeridCOLOR_LIGHTBLUEstring);
                    
SafeGivePlayerMoney(playerid, -price);
                    
PlayerInfo[playerid][pDrugs] = ammount;
                }
                else
                {
                    
SCM(playeridCOLOR_GREY"** You cant afford the Drugs !");
                    return 
1;
                }
            }
            else
            {
                
SCM(playeridCOLOR_GREY"** You are not a Drugs Dealer, or not near the Drug Package !");
                return 
1;
            }
        } 
Espero lo revisen y me puedan ayudar. De nuevo muchas gracias chicos
Reply


Messages In This Thread
Ayuda Expertos SSCANF (Scripters) - by Pablojpas - 20.06.2014, 04:09
Re: Ayuda Expertos SSCANF (Scripters) - by SickAttack - 20.06.2014, 06:11
Re: Ayuda Expertos SSCANF (Scripters) - by Daniel-92 - 20.06.2014, 13:41
Re: Ayuda Expertos SSCANF (Scripters) - by SickAttack - 20.06.2014, 14:24
Re: Ayuda Expertos SSCANF (Scripters) - by Daniel-92 - 20.06.2014, 15:47
Respuesta: Ayuda Expertos SSCANF (Scripters) - by Pablojpas - 21.06.2014, 00:33
Respuesta: Ayuda Expertos SSCANF (Scripters) - by SickAttack - 21.06.2014, 01:11
Respuesta: Ayuda Expertos SSCANF (Scripters) - by Pablojpas - 21.06.2014, 04:37

Forum Jump:


Users browsing this thread: 1 Guest(s)