#1

Can someone tell me how I can change my strcmp commands to ZCMD I really need help and cant find a tutorial
Reply
#2

Can you post all your strcmp commands?
Reply
#3

Sure. Even though some of them show like Zcmd format I only changed the top so they are the same.
PHP код:
//=================[Commands]===============================================
    
CMD:boost(playeridparams[])
    {
        if(
GetPlayerMoney(playerid) <10000)
         {
            
SendClientMessage(playerid,0xAA3333AA"You are a little low on the dough.");
          }
        else
        {
        
GivePlayerMoney(playerid,-10000);
        
AddVehicleComponent(GetPlayerVehicleID(playerid),1010);
        }
        return 
1;
         }
        
CMD:handsup(playerid,params[])
        {
         
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP);
         return 
1;
         }
         
CMD:start(playerid,params[])
         {
        
SetPlayerPos(playerid,2313.4158,-1987.8317,13.5590);
        return 
1;
        }
        
CMD:minigun(playerid,params[])
        {
          if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid0xFF0000AA"This command can only be used by an admin!!");
        
GivePlayerWeapon(playerid38500); //Give playerid minigun with 500 ammo
        
return 1;
        }
        
CMD:heal(playerid,params[])
        if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid0xFF0000AA"This command can only be used by an admin!!");
        
SetPlayerHealth(playerid100);
        return 
1;
         }
         
CMD:engine(playerid,params[])
         {
        new 
vehicleid GetPlayerVehicleID(playerid);//defining vehicleid is = to GetPlayerVehicleID.
        
new enginelightsalarmdoorsbonnetbootobjective;//these are the defines of the thing used in the command.
        
if(IsPlayerInAnyVehicle(playerid))//This will check that if a player is in the vehicle or not.
            
{
                if(
GetPlayerVehicleSeat(playerid) == 0//Now this will check that if a player is on the driving seat or not.
                
{
                    
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);//will check that what is the state of the engine.
                    
if(engine == 1)//will check that if the engine in on or not.
                    
{
                        
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);//this will check that what is the state of engine.That is is on or off.We can use it for multiple things like doors,alarms etc.But In this case I am using this for the engine only.
                        
SetVehicleParamsEx(vehicleid,false,lights,alarm,doors,bonnet,boot,objective);//when we change the engine and replace it with false,this will turn the vehicle engine off.Same if we make if true,this will make the engine on.
                        
GameTextForPlayer(playerid,"Vehicle Engine Stopped!",2000,6);//for a text to appar on the screen for only 2 seconds.
                        
return 1;
                    }
                    else
                    
SetVehicleParamsEx(vehicleid,true,lights,alarm,doors,bonnet,boot,objective);//if vehicle engine is false it will change it to true.
                    
GameTextForPlayer(playerid,"Vehicle Engine Started!",2000,6);//for a text to appar on the screen for only 2 seconds.
                
}
                else 
SendClientMessage(playerid,-1,"Error: You are not at the driving seat!");//this is an error message,that if a player is not on the driving seat,this error message would appear.
                
return 1;
            }
            else
            
SendClientMessage(playerid,-1,"Error: You are not in a vehicle!");//this is the error message,that if a player is not in the car,the error message would apper.
            
}
        
CMD:camera(playerid,params[])
          new 
Float:xFloat:yFloat:z;
        
GetPlayerCameraPos(playeridxyz);
        
printf("You are looking at at %f,%f,%f."xyz);
        }
public 
OnPlayerCommandText(playeridcmdtext[])
{
    if(!
strcmp(cmdtext"/enter"true))
    {
    if(
IsPlayerInRangeOfPoint(playerid3.01929.3467,-1776.0195,13.5469))
        {
    
SetPlayerPos(playerid,-30.946699,-89.609596,1003.549988);//Idlegas entrance
    
SetPlayerInterior(playerid18);
        }
    }
    if(!
strcmp(cmdtext"/exit"true))
    {
    if(
IsPlayerInRangeOfPoint(playerid3.0, -30.9595,-91.7379,1003.5469))
        {
    
SetPlayerPos(playerid,1929.3467,-1776.0195,13.5469);//Idlegas Exit
}
    }
     if(
strcmp(cmdtext"/music"true) == 0)
    {
    if(!
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid0xFF0000AA"You are not in a vehicle!!");
    
ShowPlayerDialog(playerid4576DIALOG_STYLE_LIST"Music","Pulse FM Pure Dance\n Hip Hop""Select""Cancel");
    }
      if (
strcmp("/v lights"cmdtexttrue10) == 0)//Head light.
    
{
        new 
vehicleid GetPlayerVehicleID(playerid);//Gets the vehicle Id of the player
        
new enginelightsalarmdoorsbonnetbootobjective;//these are the defines of the thing used in the command.
        
if(IsPlayerInAnyVehicle(playerid))//This will check that if a player is in the vehicle or not.
            
{
                if(
GetPlayerVehicleSeat(playerid) == 0//Now this will check that if a player is on the driving seat or not.
                
{
                    
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);//will check that what is the state of the lights.
                    
if(lights == 1)//will check that if the lights are on or not.
                    
{
                        
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);//this will check that what is the state of the lights.That is is on or off.We can use it for multiple things like doors,alarms etc.But In this case I am using this for the lights only.
                        
SetVehicleParamsEx(vehicleid,engine,false,alarm,doors,bonnet,boot,objective);//when we change the engine and replace it with false,this will turn the vehicle engine off.Same if we make if true,this will make the engine on.
                        
GameTextForPlayer(playerid,"The vehicle lights have been turned off.",2000,6);//for a text to appar on the screen for only 2 seconds.
                        
return 1;
                    }
                    else
                    
SetVehicleParamsEx(vehicleid,engine,true,alarm,doors,bonnet,boot,objective);//if vehicle engine is false it will change it to true.
                    
GameTextForPlayer(playerid,"The vehicle lights have turned on!",2000,6);//for a text to appar on the screen for only 2 seconds.
                
}
                else 
SendClientMessage(playerid,-1,"Error: You are not at the driving seat!");//this is an error message,that if a player is not on the driving seat,this error message would appear.
                
return 1;
                }
                else 
SendClientMessage(playerid,-1,"Error: You are not in a vehicle!");//this is the error message,that if a player is not in the car,the error message would apper.
     
}
     if (
strcmp("/frontfall"cmdtexttrue10) == 0)
    {
     
ApplyAnimation(playerid"PED""KO_shot_front",4.1,0,1,1,1,1);
     return 
1;
     }
     if (
strcmp("/stopanim"cmdtexttrue10) == 0)
    {
     
ClearAnimations(playerid);
     return 
1;
     }
    return 
0;
 } 
Reply
#4

Код:
CMD:enter(playerid, params[])
    {
    if(IsPlayerInRangeOfPoint(playerid, 3.0, 1929.3467,-1776.0195,13.5469))
        {
    SetPlayerPos(playerid,-30.946699,-89.609596,1003.549988);//Idlegas entrance
    SetPlayerInterior(playerid, 18);
        }
    }
    CMD:exit(playerid, params[])
    {
    if(IsPlayerInRangeOfPoint(playerid, 3.0, -30.9595,-91.7379,1003.5469))
        {
    SetPlayerPos(playerid,1929.3467,-1776.0195,13.5469);//Idlegas Exit
}
    }
	 CMD:music(playerid, params[])
    {
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "You are not in a vehicle!!");
    ShowPlayerDialog(playerid, 4576, DIALOG_STYLE_LIST, "Music","Pulse FM Pure Dance\n Hip Hop", "Select", "Cancel");
    }
      CMD:vlights(playerid, params[])//Head light.
    {
        new vehicleid = GetPlayerVehicleID(playerid);//Gets the vehicle Id of the player
        new engine, lights, alarm, doors, bonnet, boot, objective;//these are the defines of the thing used in the command.
        if(IsPlayerInAnyVehicle(playerid))//This will check that if a player is in the vehicle or not.
            {
                if(GetPlayerVehicleSeat(playerid) == 0) //Now this will check that if a player is on the driving seat or not.
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);//will check that what is the state of the lights.
                    if(lights == 1)//will check that if the lights are on or not.
                    {
                        GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);//this will check that what is the state of the lights.That is is on or off.We can use it for multiple things like doors,alarms etc.But In this case I am using this for the lights only.
                        SetVehicleParamsEx(vehicleid,engine,false,alarm,doors,bonnet,boot,objective);//when we change the engine and replace it with false,this will turn the vehicle engine off.Same if we make if true,this will make the engine on.
                        GameTextForPlayer(playerid,"The vehicle lights have been turned off.",2000,6);//for a text to appar on the screen for only 2 seconds.
                        return 1;
                    }
                    else
                    SetVehicleParamsEx(vehicleid,engine,true,alarm,doors,bonnet,boot,objective);//if vehicle engine is false it will change it to true.
                    GameTextForPlayer(playerid,"The vehicle lights have turned on!",2000,6);//for a text to appar on the screen for only 2 seconds.
                }
                else SendClientMessage(playerid,-1,"Error: You are not at the driving seat!");//this is an error message,that if a player is not on the driving seat,this error message would appear.
                return 1;
                }
                else SendClientMessage(playerid,-1,"Error: You are not in a vehicle!");//this is the error message,that if a player is not in the car,the error message would apper.
     }
    CMD:frontfall(playerid, params[])
    {
     ApplyAnimation(playerid, "PED", "KO_shot_front",4.1,0,1,1,1,1);
     return 1;
     }
     CMD:stopanim(playerid, params[])
    {
     ClearAnimations(playerid);
     return 1;
     }
Reply
#5

When I compile I get these errors
PHP код:
C:\Users\logan_000\Desktop\Samp server\gamemodes\lramos15.pwn(190) : warning 209: function "cmd_heal" should return a value
C
:\Users\logan_000\Desktop\Samp server\gamemodes\lramos15.pwn(190) : error 010invalid function or declaration
C
:\Users\logan_000\Desktop\Samp server\gamemodes\lramos15.pwn(190) : error 021symbol already defined"SetPlayerHealthEx"
C:\Users\logan_000\Desktop\Samp server\gamemodes\lramos15.pwn(191) : error 010invalid function or declaration
C
:\Users\logan_000\Desktop\Samp server\gamemodes\lramos15.pwn(218) : warning 209: function "cmd_engine" should return a value
C
:\Users\logan_000\Desktop\Samp server\gamemodes\lramos15.pwn(220) : error 003declaration of a local variable must appear in a compound block
C
:\Users\logan_000\Desktop\Samp server\gamemodes\lramos15.pwn(243) : warning 209: function "cmd_music" should return a value
C
:\Users\logan_000\Desktop\Samp server\gamemodes\lramos15.pwn(268) : warning 209: function "cmd_vlights" should return a value
C
:\Users\logan_000\Desktop\Samp server\gamemodes\lramos15.pwn(519) : warning 203symbol is never used"gTeam"
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase 
Ignore the symbol is never used.
Here are the lines on which the errors occur.
Line 190:
PHP код:
SetPlayerHealth(playerid100); 
Line 191:
PHP код:
return 1
Line 218:
PHP код:

Line 220:
PHP код:
new Float:xFloat:yFloat:z
Line 243:
PHP код:

Line 268:
PHP код:

Reply
#6

pawn Код:
CMD:enter(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 3.0, 1929.3467,-1776.0195,13.5469))
    {
        SetPlayerPos(playerid,-30.946699,-89.609596,1003.549988);//Idlegas entrance
        SetPlayerInterior(playerid, 18);
    }
    return 1;
}

CMD:exit(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 3.0, -30.9595,-91.7379,1003.5469)) SetPlayerPos(playerid,1929.3467,-1776.0195,13.5469);//Idlegas Exit
    return 1;
}

CMD:music(playerid, params[])
{
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "You are not in a vehicle!!");
    ShowPlayerDialog(playerid, 4576, DIALOG_STYLE_LIST, "Music","Pulse FM Pure Dance\n Hip Hop", "Select", "Cancel");
    return 1;
}

CMD:v(playerid, params[])
{
    if(!strcmp(params, "lights", true))
    {
        new vehicleid = GetPlayerVehicleID(playerid);//Gets the vehicle Id of the player
        new engine, lights, alarm, doors, bonnet, boot, objective;//these are the defines of the thing used in the command.
        if(IsPlayerInAnyVehicle(playerid))//This will check that if a player is in the vehicle or not.
        {
            if(GetPlayerVehicleSeat(playerid) == 0) //Now this will check that if a player is on the driving seat or not.
            {
                GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);//will check that what is the state of the lights.
                if(lights == 1)//will check that if the lights are on or not.
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);//this will check that what is the state of the lights.That is is on or off.We can use it for multiple things like doors,alarms etc.But In this case I am using this for the lights only.
                    SetVehicleParamsEx(vehicleid,engine,false,alarm,doors,bonnet,boot,objective);//when we change the engine and replace it with false,this will turn the vehicle engine off.Same if we make if true,this will make the engine on.
                    GameTextForPlayer(playerid,"The vehicle lights have been turned off.",2000,6);//for a text to appar on the screen for only 2 seconds.
                }
                else
                {
                    SetVehicleParamsEx(vehicleid,engine,true,alarm,doors,bonnet,boot,objective);//if vehicle engine is false it will change it to true.
                    GameTextForPlayer(playerid,"The vehicle lights have turned on!",2000,6);//for a text to appar on the screen for only 2 seconds.
                }
            }
            else SendClientMessage(playerid,-1,"Error: You are not at the driving seat!");//this is an error message,that if a player is not on the driving seat,this error message would appear.
        }
        else SendClientMessage(playerid,-1,"Error: You are not in a vehicle!");//this is the error message,that if a player is not in the car,the error message would apper.
     }
     return 1;
}

CMD:frontfall(playerid, params[])
{
    ApplyAnimation(playerid, "PED", "KO_shot_front",4.1,0,1,1,1,1);
    return 1;
}

CMD:stopanim(playerid, params[])
{
    ClearAnimations(playerid);
    return 1;
}
Reply
#7

Ok I have brought it down to 2 commands causing the errors
PHP код:
        CMD:heal(playerid,params[]) 
        if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid0xFF0000AA"This command can only be used by an admin!!"); 
        
SetPlayerHealth(playerid100); 
        return 
1
         } 
and
PHP код:
        CMD:camera(playerid,params[]) 
          new 
Float:xFloat:yFloat:z
        
GetPlayerCameraPos(playeridxyz); 
        
printf("You are looking at at %f,%f,%f."xyz); 
        } 
Reply
#8

You're missing an opening bracket ( { ) underneath the ZCMD line for both of those.

pawn Код:
CMD:heal(playerid,params[])
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "This command can only be used by an admin!!");  
    SetPlayerHealth(playerid, 100);  
    return 1;  
}  

CMD:camera(playerid,params[])
{  
    new Float:x, Float:y, Float:z;  
    GetPlayerCameraPos(playerid, x, y, z);  
    printf("You are looking at at %f,%f,%f.", x, y, z);  
}
Reply
#9

I feel really stupid now. Thanks man
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)