Unknow Command
#1

From this command on all the commands do not work, it may be something set incorrectly?
PHP код:
//==========================New Job System=========================================================//
    
if(strcmp(cmd"/sellgas"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
        new 
vehicleid GetPlayerVehicleID(playerid);
        if(
IsPlayerConnected(playerid))
        {
            new 
vehicleid GetPlayerVehicleID(playerid);
            if(
Gas[vehicleid] == 0)
            {
                
SendClientMessage(playerid,COLOR_WHITE,"Not enough gas!");
                return 
1;
            }
            if(
PlayerInfo[playerid][pJob] != 3)
            {
                
SendClientMessage(playeridCOLOR_GREY"You are not a Gas Deliver!");
                return 
1;
            }
            if(
IsPlayerInRangeOfPoint(playerid,20.0,1938.1282,-1773.7139,13.3828) || IsPlayerInRangeOfPoint(playerid,20.0,1004.0894,-940.4797,42.1797))
            {
                if(
VGas[vehicleid] == 0)
                {
                    
SendClientMessage(playerid,COLOR_WHITE,"No Fuel to sell!");
                    return 
1;
                }
                
tmp strtok(cmdtextidx);
                if(!
strlen(tmp))
                {
                    
SendClientMessage(playeridCOLOR_GRAD1"USAGE: /sellgas [amount]");
                    return 
1;
                }
                
moneys strval(tmp);
                if(
moneys 100)
                {
                    
SendClientMessage(playerid,COLOR_WHITE,"Maximum 100 litters!");
                    return 
1;
                }
                if(
moneys 1)
                {
                    
SendClientMessage(playerid,COLOR_WHITE,"Minimum 1 litters!");
                    return 
1;
                }
                if(
moneys Gas[vehicleid])
                {
                    
SendClientMessage(playerid,COLOR_WHITE,"Not enough fuel to sell!");
                    return 
1;
                }
                if(
GetVehicleModel(vehicleid) == 552)
                {
                    new 
price;
                    
price moneys*115;
                    
VGas[vehicleid] -= moneys;
                    
SendClientMessage(playerid,COLOR_WHITE,"Sold!");
                    
GivePlayerMoney(playerid,price);
                }
                else
                {
                    
SendClientMessage(playerid,COLOR_WHITE,"Your not in a Gas Deliver Vehicle!");
                }
            }
            else
            {
                new 
rand random(3);
                switch(
rand)
                {
                    case 
0:
                    {
                        
SetPlayerCheckpoint(playerid,1938.1282,-1773.7139,13.3828,10.0);
                    }
                    case 
1:
                    {
                        
SetPlayerCheckpoint(playerid,1004.0894,-940.4797,42.1797,10.0);
                    }
                    case 
2:
                    {
                        
SendClientMessage(playerid,COLOR_WHITE,"Error:Try Again.");
                    }
                }
            }
        }
        return 
1;
    } 
Reply
#2

you defined vehicleid two times
that wont even compile
Reply
#3

PHP код:
//==========================New Job System=========================================================// 
    
if(strcmp(cmd"/sellgas"true) == 0
    { 
        new 
vehicleid GetPlayerVehicleID(playerid); 
        if(
IsPlayerConnected(playerid)) 
        {  
            if(
Gas[vehicleid] == 0
            { 
                
SendClientMessage(playerid,COLOR_WHITE,"Not enough gas!"); 
                return 
1
            } 
            if(
PlayerInfo[playerid][pJob] != 3
            { 
                
SendClientMessage(playeridCOLOR_GREY"You are not a Gas Deliver!"); 
                return 
1
            } 
            if(
IsPlayerInRangeOfPoint(playerid,20.0,1938.1282,-1773.7139,13.3828) || IsPlayerInRangeOfPoint(playerid,20.0,1004.0894,-940.4797,42.1797)) 
            { 
                if(
VGas[vehicleid] == 0
                { 
                    
SendClientMessage(playerid,COLOR_WHITE,"No Fuel to sell!"); 
                    return 
1
                } 
                new 
tmp[128];
                
tmp strtok(cmdtextidx); 
                if(!
strlen(tmp)) 
                { 
                    
SendClientMessage(playeridCOLOR_GRAD1"USAGE: /sellgas [amount]"); 
                    return 
1
                } 
                new 
moneys[128];
                
moneys strval(tmp); 
                if(
moneys 100
                { 
                    
SendClientMessage(playerid,COLOR_WHITE,"Maximum 100 litters!"); 
                    return 
1
                } 
                if(
moneys 1
                { 
                    
SendClientMessage(playerid,COLOR_WHITE,"Minimum 1 litters!"); 
                    return 
1
                } 
                if(
moneys Gas[vehicleid]) 
                { 
                    
SendClientMessage(playerid,COLOR_WHITE,"Not enough fuel to sell!"); 
                    return 
1
                } 
                if(
GetVehicleModel(vehicleid) == 552
                { 
                    new 
price
                    
price moneys*115
                    
VGas[vehicleid] -= moneys
                    
SendClientMessage(playerid,COLOR_WHITE,"Sold!"); 
                    
GivePlayerMoney(playerid,price); 
                } 
                else 
                { 
                    
SendClientMessage(playerid,COLOR_WHITE,"Your not in a Gas Deliver Vehicle!"); 
                } 
            } 
            else 
            { 
                new 
rand random(3); 
                switch(
rand
                { 
                    case 
0
                    { 
                        
SetPlayerCheckpoint(playerid,1938.1282,-1773.7139,13.3828,10.0); 
                    } 
                    case 
1
                    { 
                        
SetPlayerCheckpoint(playerid,1004.0894,-940.4797,42.1797,10.0); 
                    } 
                    case 
2
                    { 
                        
SendClientMessage(playerid,COLOR_WHITE,"Error:Try Again."); 
                    } 
                } 
            } 
        } 
        return 
1
    } 
Reply
#4

Quote:
Originally Posted by FOTIS6
Посмотреть сообщение
PHP код:
//==========================New Job System=========================================================// 
    
if(strcmp(cmd"/sellgas"true) == 0
    { 
        new 
vehicleid GetPlayerVehicleID(playerid); 
        if(
IsPlayerConnected(playerid)) 
        {  
            if(
Gas[vehicleid] == 0
            { 
                
SendClientMessage(playerid,COLOR_WHITE,"Not enough gas!"); 
                return 
1
            } 
            if(
PlayerInfo[playerid][pJob] != 3
            { 
                
SendClientMessage(playeridCOLOR_GREY"You are not a Gas Deliver!"); 
                return 
1
            } 
            if(
IsPlayerInRangeOfPoint(playerid,20.0,1938.1282,-1773.7139,13.3828) || IsPlayerInRangeOfPoint(playerid,20.0,1004.0894,-940.4797,42.1797)) 
            { 
                if(
VGas[vehicleid] == 0
                { 
                    
SendClientMessage(playerid,COLOR_WHITE,"No Fuel to sell!"); 
                    return 
1
                } 
                new 
tmp[128];
                
tmp strtok(cmdtextidx); 
                if(!
strlen(tmp)) 
                { 
                    
SendClientMessage(playeridCOLOR_GRAD1"USAGE: /sellgas [amount]"); 
                    return 
1
                } 
                new 
moneys[128];
                
moneys strval(tmp); 
                if(
moneys 100
                { 
                    
SendClientMessage(playerid,COLOR_WHITE,"Maximum 100 litters!"); 
                    return 
1
                } 
                if(
moneys 1
                { 
                    
SendClientMessage(playerid,COLOR_WHITE,"Minimum 1 litters!"); 
                    return 
1
                } 
                if(
moneys Gas[vehicleid]) 
                { 
                    
SendClientMessage(playerid,COLOR_WHITE,"Not enough fuel to sell!"); 
                    return 
1
                } 
                if(
GetVehicleModel(vehicleid) == 552
                { 
                    new 
price
                    
price moneys*115
                    
VGas[vehicleid] -= moneys
                    
SendClientMessage(playerid,COLOR_WHITE,"Sold!"); 
                    
GivePlayerMoney(playerid,price); 
                } 
                else 
                { 
                    
SendClientMessage(playerid,COLOR_WHITE,"Your not in a Gas Deliver Vehicle!"); 
                } 
            } 
            else 
            { 
                new 
rand random(3); 
                switch(
rand
                { 
                    case 
0
                    { 
                        
SetPlayerCheckpoint(playerid,1938.1282,-1773.7139,13.3828,10.0); 
                    } 
                    case 
1
                    { 
                        
SetPlayerCheckpoint(playerid,1004.0894,-940.4797,42.1797,10.0); 
                    } 
                    case 
2
                    { 
                        
SendClientMessage(playerid,COLOR_WHITE,"Error:Try Again."); 
                    } 
                } 
            } 
        } 
        return 
1
    } 
When I compile crash the pawno ...
Reply
#5

Idk everything seems right, I suggest you download a include to make your life easier.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)