SA-MP Forums Archive
Command help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Command help (/showthread.php?tid=470824)



Command help - ignas1125 - 19.10.2013

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!!


Re: Command help - ignas1125 - 20.10.2013

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


Re: Command help - kbalor - 20.10.2013

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?


Re: Command help - ignas1125 - 20.10.2013

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


Re: Command help - Patrick - 20.10.2013

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;
}



Re: Command help - ignas1125 - 20.10.2013

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"


Re: Command help - EiresJason - 20.10.2013

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;
}



Re: Command help - ignas1125 - 20.10.2013

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

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




Re: Command help - DanishHaq - 20.10.2013

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.


Re: Command help - ignas1125 - 20.10.2013

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