15.05.2013, 16:00
So I've tried several times to convert this command to dcmd, and I failed somehow, read a lot of tutorials even so.. I need some help, can someone convert this to me?
Thanks in advance.
pawn Код:
if(strcmp(cmd, "/setgatepass", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] <= 0)
{
return SendClientMessage(playerid, COLOR_GREY," You're not authorized to use that command !");
}
new gateid;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
return SendClientMessage(playerid, COLOR_GREY," USAGE: /setgatepass [gateid] [password]");
}
gateid = strvalEx(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
return SendClientMessage(playerid, COLOR_GREY," USAGE: /setgatepass [gateid] [password]");
}
if(strlen(tmp) > 20)
{
return SendClientMessage(playerid, COLOR_GREY," Gate password can't be longer than 20 characters !");
}
strmid(GateInfo[gateid][gPass], tmp, 0, strlen(tmp), 23);
new reveal[256];
format(reveal, sizeof(reveal)," Gate ID %d's password has been set to '%s' !", gateid, tmp);
SendClientMessage(playerid, COLOR_GREY, reveal);
GateInfo[gateid][gPassed] = 1;
SaveGates();
return 1;
}
Thanks in advance.