20.02.2019, 22:18
Sure, here:
Nope, thats not it, I just deleted couple of lines before I posted this code. It would be an error if I complie it but I edited the post.
EDIT:
Here is the full code, I just figured it out its something else in this code even if the IsPlayerConnected line is correct:
EDIT 2:
Its fixed, I just needed to move the IsPlayerConnected line directly below the sscanf one.
PHP код:
stock ErrorTag(playerid, message[])
{
new string[128];
format(string, sizeof(string), ""TEXT_RED"[ERROR] "TEXT_WHITE"%s", message);
SendClientMessage(playerid, RED, string);
return 1;
}
Quote:
Look:
Код:
new targetID, parameter, ; |
EDIT:
Here is the full code, I just figured it out its something else in this code even if the IsPlayerConnected line is correct:
PHP код:
CMD:givemoney(playerid, params[])
{
new
targetID,
parameter,
string[128],
query[128]
;
if(pData[playerid][pAdmin] < 2) return ErrorTag(playerid, "You have no permission to use this command!");
if(sscanf(params, "ui", targetID, parameter)) return UsageTag(playerid, "/givemoney [ID] [AMOUNT]");
if(parameter < 0) return ErrorTag(playerid, "You cant use minus value.");
if(pData[targetID][pIsLoggedIn] == false) return ErrorTag(playerid, "The selected player is not logged in!");
if(!IsPlayerConnected(targetID)) return SendClientMessage(playerid, 0xFFFFFF, "Test");
mysql_format(g_sql, query, sizeof(query), "UPDATE characters SET p_money = '%d' WHERE p_name = '%e'", pData[playerid][pMoney], ReturnName(targetID));
mysql_tquery(g_sql, query);
format(string, sizeof(string), "%s gave you $%d", ReturnName(playerid), parameter);
ServerTag(targetID, string);
format(string, sizeof(string), "You gave %s $%d", ReturnName(targetID), parameter);
ServerTag(playerid, string);
GivePlayerCash(targetID, parameter);
return 1;
}
Its fixed, I just needed to move the IsPlayerConnected line directly below the sscanf one.