how to change a command to zcmd ?
#4

Here you are:

PHP код:
#include <sscanf>
CMD:drag(playeridparams[])
{
        new 
name[MAX_PLAYER_NAME], sendername[MAX_PLAYER_NAME], id;
        
GetPlayerName(idname,sizeof(name));
        if(
IsPlayerConnected(playerid))
        {
        if(
PINFO[playerid][pAdmin] <= 0)
        {
        
SCM(playerid,COLOR_ERROR,"Error: Your admin level isn't high enough to use this command");
        return 
1;
        }
        if(
sscanf(params,"i",id))
            {
                
SendClientMessage(playeridCOLOR_YELLOW"Syntax: /drag <PlayerID>");
                return 
1;
            }
            new 
newcar GetPlayerVehicleID(playerid);
            if(!
newcar) { SCM(playerid,COLOR_ERROR,"You are not in a vehicle."); return 1; }
                if(
IsPlayerConnected(id))
                {
                    if(
id != INVALID_PLAYER_ID)
                    {
                            
PutPlayerInVehicle(id,newcar,1);
                            
GetPlayerName(playeridsendernamesizeof(sendername));
                            new 
sttr[256];
                            
format(sttr,256,"Admin %s drags you to his/her vehicle.",sendername);
                            
SCM(playa,COLOR_AdminWarn,sttr);
                            
SCM(playerid,COLOR_ERROR,"Dragged.");
                    }
                }
        }
        return 
1;

NOTE: i just added sscanf.inc include to your script to let it work carefully! so if you haven't it yet download it and include it in your script.
Hope that will work with you!
Reply


Messages In This Thread
how to change a command to zcmd ? - by SH0x - 17.05.2017, 20:57
Re: how to change a command to zcmd ? - by adri[4]Life - 17.05.2017, 21:14
Re: how to change a command to zcmd ? - by BiosMarcel - 17.05.2017, 21:14
Re: how to change a command to zcmd ? - by RxErT - 18.05.2017, 02:23
Re: how to change a command to zcmd ? - by IceBilizard - 18.05.2017, 02:30
Re: how to change a command to zcmd ? - by zedshadowzw - 18.05.2017, 04:17
Re: how to change a command to zcmd ? - by SH0x - 18.05.2017, 06:16
Re: how to change a command to zcmd ? - by RxErT - 18.05.2017, 06:49
Re: how to change a command to zcmd ? - by Spoookymon - 18.05.2017, 07:10

Forum Jump:


Users browsing this thread: 3 Guest(s)