19.03.2018, 14:18
Can someone help mi with this commands ?
the problem is for example: when i type /tmute 0 test 1
it returns "Използвай: /tmute [playerid] [reason] [time]"
Help me please
Код:
if(strcmp(cmd,"/tmute",true)==0) { if(pInfo[playerid][pAdmin] >= 2) { tmp = strtok(cmdtext,idx); if(!strlen(tmp)) { SendClientMessage(playerid,-1,"Използвай: /tmute [playerid] [reason] [time]"); return 1; } new player = ReturnUser(tmp); if(IsPlayerConnected(player)) { if(player != INVALID_PLAYER_ID) { new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[256]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid,-1,"Използвай: /tmute [playerid] [reason] [time]"); return 1; } tmp = strtok(cmdtext,idx); new time = strval(tmp); if(!strval(tmp)) { SendClientMessage(playerid,-1,"Използвай: /tmute [playerid] [reason] [time]"); return 1; } if(pInfo[player][pMuted] == 0) { pInfo[player][pMuted] = 1; pInfo[player][pMutedTime] = (gettime() + time*60); format(string,sizeof(string),"%s беше заглушен от администратор %s за %d минути! [Причина: %s]",GetName(player),GetName(playerid),result,time); SendClientMessageToAll(0xFF0000FF,string); } } } } else { SendClientMessage(playerid, 0xFF0000FF, "Нямаш права за да ползваш командата!"); return 1; } return 1; }
it returns "Използвай: /tmute [playerid] [reason] [time]"
Help me please