Creating commands and using what? - 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)
+--- Thread: Creating commands and using what? (
/showthread.php?tid=561506)
Creating commands and using what? -
Alvin007 - 03.02.2015
Hello all, actually i implemented a login and register system all works fine with dialogs.
I made a make admin script and works fine.
Here
PHP код:
if (strcmp("/makemeadmin", cmdtext, true, 10) == 0) //strcmp(
{
if(IsPlayerAdmin(playerid)==1)
{
new string[40];
new alvl;
alvl=1337;
PlayerInfo[playerid][pAdmin]=alvl;
format(string,sizeof(string),"you have set your admin level to %i",alvl);
SendClientMessage(playerid,WHITE,string);
return 1;
}
else SendClientMessage(playerid,RED,"You are not BBFN"); return 1;
}
But i'm not sure if this structure => (strcmp("/makemeadmin", cmdtext, true, 10) == 0)
Is a good one to use for future commands.
I saw examples of zcmd or ycmd smth like that
Can you guys explain further and give me good tutorial links about a good commanding systems?
Thanks alot.
Re: Creating commands and using what? -
CalvinC - 03.02.2015
There's several command processors available, as you said, like zcmd and y_commands.
They're faster to process commands than using Strcmp under OnPlayerText, you should definitely use them.
Re : Creating commands and using what? -
Alvin007 - 03.02.2015
Ok thank you for the advice, +REP.