ZCMD helP!
#1

whenever i compile this i get these errors
C:\Users\Jeremy.Jeremy-HP\Desktop\Games\Server\gamemodes\script1.pwn(441) : error 029: invalid expression, assumed zero
C:\Users\Jeremy.Jeremy-HP\Desktop\Games\Server\gamemodes\script1.pwn(441) : error 017: undefined symbol "cmd_setname"
C:\Users\Jeremy.Jeremy-HP\Desktop\Games\Server\gamemodes\script1.pwn(441) : error 029: invalid expression, assumed zero
C:\Users\Jeremy.Jeremy-HP\Desktop\Games\Server\gamemodes\script1.pwn(441) : fatal error 107: too many error messages on one line

pawn Код:
CMD:setname(playerid, params[]);
    {
        new pName[MAX_PLAYER_NAME]
        tmp = strtok(cmdtext, idx);
        giveplayerid = ReturnUser(tmp);
        if(PlayerInfo[playerid][Admin] >= 3)
        {
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, 0xFF0000AA, "USAGE: /setname [ID] [Name]");
                return 1;
            }
            else
            {
                if(sscanf(params, "ui", giveplayerid, pName))
                {
                    SetPlayerName(giveplayerid, pName);
                    return 1;
                }
            }
        else
        {
            SendClientMessage(playerid, 0xFF0000AA, "You are not an Admin!");
            return 1;
        }
        return 1;
    }
Reply
#2

Help me, I was pushed to use ZCMD and is really putting me off using it again and i was using strcmp earlier.
Reply
#3

pawn Код:
CMD:setname(playerid, params[]);
{
        new pName[MAX_PLAYER_NAME]
        tmp = strtok(cmdtext, idx);
        giveplayerid = ReturnUser(tmp);
        if(PlayerInfo[playerid][Admin] >= 3)
        {
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, 0xFF0000AA, "USAGE: /setname [ID] [Name]");
                return 1;
            }
            else
            {
                if(sscanf(params, "ui", giveplayerid, pName))
                {
                    SetPlayerName(giveplayerid, pName);
                    return 1;
                }
            }
        else
        {
            SendClientMessage(playerid, 0xFF0000AA, "You are not an Admin!");
            return 1;
        }
        return 1;
    }
Maybe the bracket was messing it up.
Reply
#4

pawn Код:
CMD:setname(playerid, params[])
{
        new pName[MAX_PLAYER_NAME]
        tmp = strtok(cmdtext, idx);
        giveplayerid = ReturnUser(tmp);
        if(PlayerInfo[playerid][Admin] >= 3)
        {
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, 0xFF0000AA, "USAGE: /setname [ID] [Name]");
                return 1;
            }
            else
            {
                if(sscanf(params, "ui", giveplayerid, pName))
                {
                    SetPlayerName(giveplayerid, pName);
                    return 1;
                }
            }
        else
        {
            SendClientMessage(playerid, 0xFF0000AA, "You are not an Admin!");
            return 1;
        }
        return 1;
    }
Should work.
Reply
#5

pawn Код:
CMD:setname(playerid, params[]) {
    new
        szUser,
        szNewName[MAX_PLAYER_NAME]
    ;
    if(PlayerInfo[playerid][Admin] >= 3) {
        if(!sscanf(params, "us[24]", szUser, szNewName)) {
            if(!IsPlayerConnected(szUser)) return SendClientMessage(playerid, 0xFF0000AA, "You are not an Admin!");
            return SetPlayerName(szUser, pName);
        }
        else return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /setname [playerid/partofname] [newname]");
    }
    else return SendClientMessage(playerid, 0xFF0000AA, "You are not an Admin!");
}
^Jack Wilson, you should read the SSCANF topic before fixing errors like this
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)