Can someone sort this out please;3
#1

If I do this(logged as RCON)
pawn Код:
CMD:setgm(playerid, params[])
{
    if(playerVariables[playerid][pGamemaster] == 5 || IsPlayerAdmin(playerid))
    {
        new id, string[128], string2[128], level, szQuery[128];
        if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "|- [Error] /setgm [id] [level]");
       
        format(string, sizeof(string), "You have set {1B8AE4}%s(%d)"COLOR_GREEN" to level %d gamemaster.", GetName(id), playerid, level);
        SendClientMessage(id, COLOR_GREEN, string);
        format(string2, sizeof(string2), "You have been given level %d gamemaster by {1B8AE4}%s(%d)", GetName(id), level);
        SendClientMessage(playerid, COLOR_GREEN, string);
        format(szQuery, sizeof(szQuery), "UPDATE players SET Gamemaster = '%d' WHERE ID = %d", playerVariables[id][pGamemaster], playerVariables[id][pDBID]);

    }
    return 1;
}
All it says is "You have set *name*(id) to a level 0 gamemaster!" even if you do "/setgm 0 5"
and sends it to you(twice)
Reply
#2

what are the errors
Reply
#3

Nothing.
Reply
#4

pawn Код:
CMD:setgm(playerid, params[])
{
    if(playerVariables[playerid][pGamemaster] == 5 || IsPlayerAdmin(playerid))
    {
        new id, level;
        if(sscanf(params, "rd", id, level)) return SendClientMessage(playerid, COLOR_RED, "|- [Error] /setgm [id] [level]");

        new szQuery[128];
        playerVariables[id][pGamemaster] = level;
        format(szQuery, sizeof(szQuery), "You have set {1B8AE4}%s(%d)"COLOR_GREEN" to level %d gamemaster.", GetName(id), id, level);
        SendClientMessage(playerid, COLOR_GREEN, szQuery);
        format(szQuery, sizeof(szQuery), "You have been given level %d gamemaster by {1B8AE4}%s(%d)", level,GetName(playerid), playerid);
        SendClientMessage(id, COLOR_GREEN, szQuery);
        format(szQuery, sizeof(szQuery), "UPDATE players SET Gamemaster = '%d' WHERE ID = %d", playerVariables[id][pGamemaster], playerVariables[id][pDBID]);

    }
    return 1;
}
Reply
#5

ommm ill try my best i guess...

Код:
if (playerVariables[playerid][pGamemaster] == 5 || IsPlayerAdmin(playerid))
try this
Reply
#6

pawn Код:
format(string, sizeof(string), "You have set {1B8AE4}%s(%d)"COLOR_GREEN" to level %d gamemaster.", GetName(id), id, level);
SendClientMessage(id, COLOR_GREEN, string);
format(string2, sizeof(string2), "You have been given level %d gamemaster by {1B8AE4}%s(%d)", level, GetName(playerid));
SendClientMessage(playerid, COLOR_GREEN, string2);
You were sending 'string' twice, and your formatting was off
Reply
#7

It works, but...
pawn Код:
format(szQuery, sizeof(szQuery), "UPDATE players SET Gamemaster = '%d' WHERE ID = %d", playerVariables[id][pGamemaster], playerVariables[id][pDBID]);
        ------------mysql_query(szQuery);---------------
it says mysql_query is undefined.
Reply
#8

You're using the R7 version of the plugin, aren't you?
Reply
#9

I think so, yeah.
Reply
#10

Try and downgrade to the R6 version, it worked with me when I had the "undefined symbol "mysql_query" error.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)