28.01.2013, 11:04
(
Last edited by Jaggy; 28/01/2013 at 11:58 AM.
)
To create a command with out "zcmd".inc
1. Create / load your script
2. then you must go bellow
and you will find :
or if you don't find it and you already removed it then write it again
3. replace the /mycommand with your command
4. and replace the //do something here with your command action
5. and if you compelete it press (compile/run)
(NOTE): if you have some errors tell me
and if you want to add other and other commands
you have make likethis :
so you must add to the :
add like that :
1. Create / load your script
2. then you must go bellow
and you will find :
Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
return 0;
}
3. replace the /mycommand with your command
4. and replace the //do something here with your command action
5. and if you compelete it press (compile/run)
(NOTE): if you have some errors tell me
and if you want to add other and other commands
you have make likethis :
Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/kill", cmdtext, true, 10) == 0)
{
SetPlayerHealth(playerid, 0)
return 1;
}
return 0;
}
Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/kill", cmdtext, true, 10) == 0)
{
SetPlayerHealth(playerid, 0)
return 1;
}
return 0;
}
Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/kill", cmdtext, true, 10) == 0)
{
setplayerhealth(playerid, 0)
return 1;
}
if (strcmp("/healme", cmdtext, true, 10) == 0)
{
setplayerhealth(playerid, 100)
setplayerarmour(playerid, 100)
return 1;
}
return 0;
}



