SA-MP Forums Archive
How to edit this little cmd to zcmd [it is small command ] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to edit this little cmd to zcmd [it is small command ] (/showthread.php?tid=250900)



How to edit this little cmd to zcmd [it is small command ] - sMog. - 24.04.2011

Hello how to make this like

COMMAND:....
bla bla

I hope you understand in to zcmd

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    new 
cmd[256],idx;
    
cmd strtok(cmdtext,idx);
    
    if(
strcmp(cmd,"/drift",true) == 0)
    {
        new 
tmp[30];
        
tmp strtok(cmdtext,idx);
        if(!
strlen(tmp) || strval(tmp) < || strval(tmp) > 53) return SendClientMessage(playeridCOLOR_YELLOW"ERROR: Invalid Drift place. It can be only from 1 to 53!");
        
PlayerGoesDrift(playeridDriftCoords[strval(tmp)-1][0], DriftCoords[strval(tmp)-1][1], DriftCoords[strval(tmp)-1][2], DriftCoords[strval(tmp)-1][3], DriftCoords[strval(tmp)-1][4]);
        return 
1;
    }
    return 
0;




Re: How to edit this little cmd to zcmd [it is small command ] - xir - 24.04.2011

edit nvm


Re: How to edit this little cmd to zcmd [it is small command ] - sMog. - 24.04.2011

okay

if i write /drift it works but if i write /drift 1 or /drift1 it says unknown command
EDIT: It wont work if i type /drift 1 = invalid command if i type /drift 11 i goto drift 1 if /drift 12 i goto /drift 2 ?


Re: How to edit this little cmd to zcmd [it is small command ] - aircombat - 26.04.2011

that should work :

pawn Код:
COMMAND:drift(playerid,params[])
{
    if(!strlen(params) || strval(params) < 1 || strval(params) > 53) return SendClientMessage(playerid, COLOR_YELLOW, "ERROR: Invalid Drift place. It can be only from 1 to 53!");
    PlayerGoesDrift(playerid, DriftCoords[strval(params)-1][0], DriftCoords[strval(params)-1][1], DriftCoords[strval(params)-1][2], DriftCoords[strval(params)-1][3], DriftCoords[strval(params)-1][4]);
    return 1;
}