How to edit this little cmd to zcmd [it is small command ]
#1

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;

Reply
#2

edit nvm
Reply
#3

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 ?
Reply
#4

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)