Help my plz!
#1

how change this script <zcmd> in strcmp

Код:
//at top of script
#include <zcmd>
forward UnmutePlayer(playerid);
new Muted[MAX_PLAYERS];


zcmd(mute, playerid, params[]) //with time in minutes
{
    if(IsPlayerAdmin(playerid))
    {
        new mplayer, time, reason[96];
        if(!sscanf(params, "uis", mplayer, time, reason))
        {
            Muted[mplayer] = 1;
            SetTimerEx("UnmutePlayer", false, 60000*time, "i", playerid);
            new string[128], name[MAX_PLAYER_NAME];
            GetPlayerName(playerid, name, sizeof(name));
            format(string, sizeof(string), "You were muted by %s for %d minutes. Reason: %s", name, time, reason);
            SendClientMessage(mplayer, 0xFF3300FF, string);
            return 1;
        }
        else return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /mute [id/partname] [time in minutes] [reason]);
    }
    else return SendClientMessage(playerid, 0xFF3300FF, "ERROR: You are not an admin and may not use this command!");
}

public UnmutePlayer(playerid)
{
    SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: You have been unmuted.");
    Muted[playerid] = 0;
}

public OnPlayerText(playerid, text[])
{
    if(Muted[playerid]) SendClientMessage(playerid, 0xFF3300FF, "SERVER: You are muted and may not speak!"), return 0;
    else return 1;
}
Reply
#2

change..

zcmd(mute, playerid, params[])

to..

CMD:mute(playerid, params[])
Reply
#3

No he Said Strcmp
So change it to
pawn Код:
if (strcmp("/Mute",cmdtext,true) == 0);
And Put it Under OnPlayerCommand
Reply
#4

Quote:
Originally Posted by Mr_Scripter
Посмотреть сообщение
No he Said Strcmp
So change it to
pawn Код:
if (strcmp("/Mute(playerid,params[])
And Put it Under OnPlayerCommand
That is'nt gonna work.
Reply
#5

Oops yea My Bad
pawn Код:
if (strcmp("/Mute",cmdtext,true) == 0)
LOL Sorry
Reply
#6

Nvm, my strcmp knowledge sucks.
Reply
#7

Again, that's not going to help him either, stop suggesting stupid things.

TeNtAtI0N: Why do you want to convert the commands? It's much easier to use zcmd in comparison to strcmp/strtok and it's a lot faster.
Reply
#8

haha calg00ne signature changed? i told you Mr187 is unbanned
Reply
#9

Hmmm ... don't work ...

Код:
C:\Documents and Settings\Administrator\Desktop\The Godfather GM\gamemodes\gf.pwn(23087) : error 037: invalid string (possibly non-terminated string)
C:\Documents and Settings\Administrator\Desktop\The Godfather GM\gamemodes\gf.pwn(23092) : error 017: undefined symbol "params"
C:\Documents and Settings\Administrator\Desktop\The Godfather GM\gamemodes\gf.pwn(23096) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\Administrator\Desktop\The Godfather GM\gamemodes\gf.pwn(23102) : error 037: invalid string (possibly non-terminated string)
C:\Documents and Settings\Administrator\Desktop\The Godfather GM\gamemodes\gf.pwn(23102) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrator\Desktop\The Godfather GM\gamemodes\gf.pwn(23102) : error 017: undefined symbol "mute"
C:\Documents and Settings\Administrator\Desktop\The Godfather GM\gamemodes\gf.pwn(23102) : fatal error 107: too many error messages on one line
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)