SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 24/04/2011, 11:19 PM   #1
sMog.
Big Clucker
 
sMog.'s Avatar
 
Join Date: Feb 2011
Location: Finland, Ikaalinen
Posts: 129
Reputation: 0
Default How to edit this little cmd to zcmd [it is small command ]

Hello how to make this like

COMMAND:....
bla bla

I hope you understand in to zcmd

PHP Code:
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;

sMog. is offline  
Old 24/04/2011, 11:23 PM   #2
xir
Gangsta
 
Join Date: Aug 2010
Posts: 746
Reputation: 3
Default Re: How to edit this little cmd to zcmd [it is small command ]

edit nvm

Last edited by xir; 25/04/2011 at 08:36 AM.
xir is offline  
Old 24/04/2011, 11:26 PM   #3
sMog.
Big Clucker
 
sMog.'s Avatar
 
Join Date: Feb 2011
Location: Finland, Ikaalinen
Posts: 129
Reputation: 0
Default Re: How to edit this little cmd to zcmd [it is small command ]

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 ?

Last edited by sMog.; 25/04/2011 at 12:17 AM.
sMog. is offline  
Old 26/04/2011, 09:50 PM   #4
aircombat
High-roller
 
Join Date: Feb 2010
Posts: 1,535
Reputation: 9
Default Re: How to edit this little cmd to zcmd [it is small command ]

that should work :

pawn Code:
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;
}
__________________

aircombat is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Small zcmd problem Dj_maryo1993 Help Archive 5 24/10/2010 10:28 AM
PM Command for ZCMD Torran Help Archive 7 10/03/2010 02:19 PM
Can someone edit this command killdahobo99 Help Archive 4 24/07/2009 03:00 AM
/edit command problem ultras Help Archive 5 10/04/2009 08:27 AM


All times are GMT. The time now is 04:14 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.