IsPlayerConnected problem
#4

Sure, here:

PHP код:
stock ErrorTag(playeridmessage[])
{
    new 
string[128];
    
format(stringsizeof(string), ""TEXT_RED"[ERROR] "TEXT_WHITE"%s"message);
    
SendClientMessage(playeridREDstring);
    return 
1;

Quote:
Originally Posted by CherryMond
Посмотреть сообщение
Look:
Код:
new 
        targetID, 
        parameter, 
    ;
Delete comma (,)after parameter.
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:
PHP код:
CMD:givemoney(playeridparams[])
{
    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"targetIDparameter)) 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(playerid0xFFFFFF"Test");
    
mysql_format(g_sqlquerysizeof(query), "UPDATE characters SET p_money = '%d' WHERE p_name = '%e'"pData[playerid][pMoney], ReturnName(targetID));
    
mysql_tquery(g_sqlquery);
    
format(stringsizeof(string), "%s gave you $%d"ReturnName(playerid), parameter);
    
ServerTag(targetIDstring);
    
format(stringsizeof(string), "You gave %s $%d"ReturnName(targetID), parameter);
    
ServerTag(playeridstring);
    
GivePlayerCash(targetIDparameter);
    return 
1;

EDIT 2:

Its fixed, I just needed to move the IsPlayerConnected line directly below the sscanf one.
Reply


Messages In This Thread
IsPlayerConnected problem - by polygxn - 20.02.2019, 21:56
Re: IsPlayerConnected problem - by DaniceMcHarley - 20.02.2019, 22:14
Re: IsPlayerConnected problem - by CherryMond - 20.02.2019, 22:17
Re: IsPlayerConnected problem - by polygxn - 20.02.2019, 22:18
Re: IsPlayerConnected problem - by Undef1ned - 20.02.2019, 22:43
Re: IsPlayerConnected problem - by polygxn - 20.02.2019, 22:53
Re: IsPlayerConnected problem - by AdamsLT - 20.02.2019, 23:11
Re: IsPlayerConnected problem - by polygxn - 20.02.2019, 23:21

Forum Jump:


Users browsing this thread: 2 Guest(s)