Command help
#1

Need GUI that when you write in input number like "10000" ant than click "agree" ant you need write name that you want to give that "10000" score, but! i need this when the player is offline (and i need it in dini)
If you can help i really glad!!
Reply
#2

BUMP i need that because when player register i cant give him score when he is offline
Reply
#3

Can you please explain it clearly?

Do you want a command like /givescore <PlayerId/Name> <Score> that even if he is offline you can still change his score?
Reply
#4

Yes i want
/givescore <PlayerId/Name> <Score> to set score even he is offline!
Reply
#5

Quote:
Originally Posted by ignas1125
Посмотреть сообщение
Yes i want
/givescore <PlayerId/Name> <Score> to set score even he is offline!
What saving system are you using?, Never mind I saw you using (dini), Code in Progress

Code should look something like this
pawn Код:
CMD:setscore(playerid, params[])
{
    new
        pName [ 24 ],
        ScoreAmount,
        AccountFile [ 70 ],
        string [ 90 ]
    ;
    if(sscanf(params, "s[24]", pName, ScoreAmount)) return SendClientMessage(playerid, -1, "/setscore [PlayerName] [Score Amount]");

    format(AccountFile, sizeof(AccountFile), Your_Path, pName); //Your_Path should look something like this Users/pds2k12.ini but instead of name you put %s

    if(!dini_Exists(AccountFile)) return format(string, sizeof(string), "There is an issue locating '%s' in the database.", pName), SendClientMessage(playerid, -1, string);
   
    if(dini_Exists(AcountFile))
    {
        dini_IntSet(AcountFile, "Score", ScoreAmount);
    }
    return 1;
}
Reply
#6

Remade by my self
Quote:

new
pName [ 24 ],
params [ 77 ],
ScoreAmount,
AccountFile [ 70 ],
string [ 90 ]
;
if(sscanf(params, "s[24]", pName, ScoreAmount)) return SendClientMessage(playerid, -1, "/setscore [PlayerName] [Score Amount]");

format(AccountFile, sizeof(AccountFile), "saves/user/%s.ini", pName); //Your_Path should look something like this Users/pds2k12.ini but instead of name you put %s

if(!dini_Exists(AccountFile)) return format(string, sizeof(string), "There is an issue locating '%s' in the database.", pName), SendClientMessage(playerid, -1, string);

if(dini_Exists(AcountFile)) //Errrorss
{
dini_IntSet(AcountFile, "Score", ScoreAmount); //errrorss
}
return 1;
}

errors:
error 017: undefined symbol "AcountFile"
error 017: undefined symbol "AcountFile"
Reply
#7

pawn Код:
new
pName [ 24 ],
params [ 77 ],
ScoreAmount,
AccountFile [ 70 ],
string [ 90 ]
;
if(sscanf(params, "s[24]", pName, ScoreAmount)) return SendClientMessage(playerid, -1, "/setscore [PlayerName] [Score Amount]");

format(AccountFile, sizeof(AccountFile), "saves/user/%s.ini", pName); //Your_Path should look something like this Users/pds2k12.ini but instead of name you put %s

if(!dini_Exists(AccountFile)) return format(string, sizeof(string), "There is an issue locating '%s' in the database.", pName), SendClientMessage(playerid, -1, string);

if(dini_Exists(AccountFile)) //Errrorss -> you forgot a 'c'.
{
dini_IntSet(AccountFile, "Score", ScoreAmount); //errrorss -> you forgot a 'c'.
}
return 1;
}
Reply
#8

Hmmm don't working i use not cmd but
Quote:

if(strcmp(cmdtext, "/setscoreoff", true)==0)

Reply
#9

Quote:
Originally Posted by ignas1125
Посмотреть сообщение
Hmmm don't working i use not cmd but
Use ZCMD, it's a hell of a lot faster, and use sscanf with it.
Reply
#10

If i use ZCMD i gonna need remake all commands that made by strcmp ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)