/veh - /carcomponent
#1

Hey guys how can i change miЎy code to zcmd?

PHP код:
if(strcmp(cmd"/veh"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if (
PlayerInfo[playerid][pAdmin] < 2)
            {
                
SendClientMessage(playeridCOLOR_GRAD"You are not authorized to use that command!");
                return 
1;
            }
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD"USAGE: /veh [Car ID] [Color ID 1] [Color ID 2]");
                return 
1;
            }
            new 
car;
            
car strval(tmp);
            if(
car 400 || car 611) { SendClientMessage(playeridCOLOR_GRAD"   Vehicle Number can't be below 400 or above 611 !"); return 1; }
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD"USAGE: /veh [Car ID] [Color ID 1] [Color ID 2]");
                return 
1;
            }
            new 
color1;
            
color1 strval(tmp);
            if(
color1 || color1 126) { SendClientMessage(playeridCOLOR_GRAD"   Color Number can't be below 0 or above 126 !"); return 1; }
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USAGE: /veh [Car ID] [Color ID 1] [Color ID 2]");
                return 
1;
            }
            new 
color2;
            
color2 strval(tmp);
            if(
color2 || color2 255) { SendClientMessage(playeridCOLOR_GREY"   Color Number can't be below 0 or above 255 !"); return 1; }
            new 
Float:X,Float:Y,Float:Z;
            
GetPlayerPos(playeridX,Y,Z);
            new 
carid CreateVehicle(carX+4,Y,Z0.0color1color212000);
            
CreatedCars[CreatedCar] = carid;
            
PutPlayerInVehicle(playeridcarid0);
            
CreatedCar ++;
            
format(stringsizeof(string), "   Vehicle %d spawned."carid);
            
SendClientMessage(playeridCOLOR_GREYstring);
        }
        return 
1;
    }
if(
strcmp(cmd"/addcomponent"true) == 0
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
PlayerInfo[playerid][pAdmin] > 3)
            {
                
tmp strtok(cmdtextidx);
                if(!
strlen(tmp))
                {
                    
SendClientMessage(playeridCOLOR_GRAD1"USAGE: /addcomponent [ComponentID]");
                    return 
1;
                }
                if(!
IsPlayerInAnyVehicle(playerid))
                {
                    
SendClientMessage(playeridCOLOR_GREY"  You are not in a vehicle!");
                    return 
1;
                }
                {
                    new 
componentid;
                    
componentid strval(tmp);
                    new 
CarId GetPlayerVehicleID(playerid);
                    if(
componentid 1000 || componentid 1193) { SendClientMessage(playeridCOLOR_GREY"   Component ID can't be below 1000 or above 1193 !"); return 1; }
                    
AddVehicleComponent(CarIdcomponentid);
                    
SendClientMessage(playeridCOLOR_GREEN" Type /carcomponents for more info!");
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GREEN" You are not an Admin.");
                return 
1;
            }
        }
        return 
1;
    }
if(
strcmp(cmd"/carcomponents"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
PlayerInfo[playerid][pAdmin] > 3)
            {
                
SendClientMessage(playeridCOLOR_WHITE" Car Components List");
                
SendClientMessage(playeridCOLOR_GREEN" Transfenders spoilers - 1000 - 1003");
                
SendClientMessage(playeridCOLOR_GREEN" Roof - 1006");
                
SendClientMessage(playeridCOLOR_GREEN" x10 Nos - 1010");
                
SendClientMessage(playeridCOLOR_GREEN" Shadow Rims - 1073");
                
SendClientMessage(playeridCOLOR_GREEN" Mega Rims - 1074");
                
SendClientMessage(playeridCOLOR_GREEN" Rimshine Rims- 1075");
                
SendClientMessage(playeridCOLOR_GREEN" Wires Rims - 1076");
                
SendClientMessage(playeridCOLOR_GREEN" Classic Rims - 1077");
                
SendClientMessage(playeridCOLOR_GREEN" Twist Rims - 1078");
                
SendClientMessage(playeridCOLOR_GREEN" Cutter Rims - 1079");
                
SendClientMessage(playeridCOLOR_GREEN" Switch Rims - 1080");
                
SendClientMessage(playeridCOLOR_GREEN" Grove Rims - 1081");
                
SendClientMessage(playeridCOLOR_GREEN" Import Rims - 1082");
                
SendClientMessage(playeridCOLOR_GREEN" Dollar Rims - 1083");
                
SendClientMessage(playeridCOLOR_GREEN" Trance Rims - 1084");
                
SendClientMessage(playeridCOLOR_GREEN" Atomic Rims - 1085");
                
SendClientMessage(playeridCOLOR_GREEN" Hydraulics - 1087");
                
SendClientMessage(playeridCOLOR_GREEN" Uranus Spoiler - 1063 - 1064");
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GREEN" You are not an Admin.");
                return 
1;
            }
        }
        return 
1;
    } 
Also can u explaint me please? cuz i read a guide but i still understand
Reply


Messages In This Thread
/veh - /carcomponent - by Jaua10 - 02.10.2017, 04:54
Re: /veh - /carcomponent - by Zeth - 02.10.2017, 05:57
Re: /veh - /carcomponent - by Jaua10 - 02.10.2017, 07:29
Re: /veh - /carcomponent - by Zeth - 02.10.2017, 14:48
Re: /veh - /carcomponent - by Jaua10 - 02.10.2017, 15:00
Re: /veh - /carcomponent - by n00blek - 02.10.2017, 15:17
Re: /veh - /carcomponent - by Jaua10 - 02.10.2017, 16:00
Re: /veh - /carcomponent - by Zeth - 02.10.2017, 16:09
Re: /veh - /carcomponent - by Jaua10 - 02.10.2017, 16:27
Re: /veh - /carcomponent - by Jaua10 - 02.10.2017, 22:18

Forum Jump:


Users browsing this thread: 1 Guest(s)