Setting for Player Health to 99 good idea? -
RollTi - 19.04.2012
Not sure but i follow some AntiCheat Expert Hint
Setting the player health to 99 is one of good idea
but the problem is yeah i remove the vending machine
how about my food system? should i remove the food system?
or if player has health 99 i will set their health to current one to avoid the
health hack detection?
and here is last question:
i need help with this i get a warning called 'Tag Mismatch'
pawn Код:
CMD:changepass(playerid, params[])
{
new newpass[50];
new oldpass = pInfo[playerid][Pass];
new INI:file = INI_Open(PlayerPath(playerid));
if(sscanf(params, "ss[50]", oldpass, newpass)) return SendClientMessage(playerid, COLOR_GREY, "SYNTAX: /changepass [oldpass] [newpass]");
if(strval(pInfo[playerid][Pass]) < 0) return SendClientMessage(playerid, COLOR_GREY, "Don't leave the line called 'oldpass' blank!");
if(strval(newpass) < 0) return SendClientMessage(playerid, COLOR_GREY, "Don't leave the line called 'newpass' blank!");
if(!oldpass == pInfo[playerid][Pass]) return SendClientMessage(playerid, COLOR_GREY, "That is not your oldpassword!");
INI_WriteInt(file, "Pass", udb_hash(newpass));
INI_Close(file);
return 1;
}
Re: Setting for Player Health to 99 good idea? -
RollTi - 19.04.2012
Up Up!
Re: Setting for Player Health to 99 good idea? -
IstuntmanI - 19.04.2012
At food system, the biggest health that he can have make to be 99, use GetPlayerHealth.
Where's the tag mismatch error ? I think that is on this line:
Код:
if(!oldpass == pInfo[playerid][Pass]) return SendClientMessage(playerid, COLOR_GREY, "That is not your oldpassword!");
You can't compare 2 strings like this, you must use strcmp, this:
Код:
if( strcmp( oldpass, pInfo[playerid][Pass], true ) != 0 ) return SendClientMessage(playerid, COLOR_GREY, "That is not your oldpassword!");
Re: Setting for Player Health to 99 good idea? -
RollTi - 19.04.2012
Thanks about that health hack
now lets go back in the question:
when i try your code i get this
pawn Код:
argument type mismatch (argument 1)
Re: Setting for Player Health to 99 good idea? -
IstuntmanI - 19.04.2012
Quote:
Originally Posted by RollTi
Thanks about that health hack
now lets go back in the question:
when i try your code i get this
pawn Код:
argument type mismatch (argument 1)
|
Change
Код:
new oldpass = pInfo[playerid][Pass];
to
Код:
new oldpass[50] = pInfo[playerid][Pass];
Re: Setting for Player Health to 99 good idea? -
RollTi - 19.04.2012
Finally got it Thanks here is rep+ for you
Just to make sure did i finally make it string?
pawn Код:
new string[90];
new oldpass = pInfo[playerid][Pass];
format(string, 90, "%i", oldpass);
if(strcmp(string, pInfo[playerid][Pass], true) != 0) return SendClientMessage(playerid, COLOR_GREY, "That is not your oldpassword!");
Re: Setting for Player Health to 99 good idea? -
IstuntmanI - 19.04.2012
Quote:
Originally Posted by RollTi
Finally got it Thanks here is rep+ for you
Just to make sure did i finally make it string?
pawn Код:
new string[90]; new oldpass = pInfo[playerid][Pass]; format(string, 90, "%i", oldpass); if(strcmp(string, pInfo[playerid][Pass], true) != 0) return SendClientMessage(playerid, COLOR_GREY, "That is not your oldpassword!");
|
It's not ok, replace your code from original command:
Код:
new oldpass = pInfo[playerid][Pass];
with this:
Код:
new oldpass[50];
format( oldpass, 50, "%s", pInfo[playerid][Pass] );
Re: Setting for Player Health to 99 good idea? -
RollTi - 19.04.2012
Now great it compile but when i try in game
pawn Код:
CMD:changepass(playerid, params[])
{
new newpass[50], oldpass[50];
format(oldpass, 50, "%s", pInfo[playerid][Pass]);
new INI:file = INI_Open(PlayerPath(playerid));
if(sscanf(params, "s[50]s[50]", oldpass, newpass)) return SendClientMessage(playerid, COLOR_GREY, "SYNTAX: /changepass [oldpass] [newpass]");
if(strval(pInfo[playerid][Pass]) < 0) return SendClientMessage(playerid, COLOR_GREY, "Don't leave the line called 'oldpass' blank!");
if(strval(newpass) < 0) return SendClientMessage(playerid, COLOR_GREY, "Don't leave the line called 'newpass' blank!");
if(strcmp(oldpass, pInfo[playerid][Pass], true) != 0) return SendClientMessage(playerid, COLOR_GREY, "That is not your oldpassword!");
INI_WriteInt(file, "Pass", udb_hash(newpass));
INI_Close(file);
return 1;
}
'/changepass 0913456373 iloveyou'
it says "That is not your oldpass!"
maybe this is because my saving system is hasing my password?
i use dudb to hash my password
Re: Setting for Player Health to 99 good idea? -
IstuntmanI - 19.04.2012
Quote:
Originally Posted by RollTi
Now great it compile but when i try in game
pawn Код:
CMD:changepass(playerid, params[]) { new newpass[50], oldpass[50]; format(oldpass, 50, "%s", pInfo[playerid][Pass]); new INI:file = INI_Open(PlayerPath(playerid)); if(sscanf(params, "s[50]s[50]", oldpass, newpass)) return SendClientMessage(playerid, COLOR_GREY, "SYNTAX: /changepass [oldpass] [newpass]"); if(strval(pInfo[playerid][Pass]) < 0) return SendClientMessage(playerid, COLOR_GREY, "Don't leave the line called 'oldpass' blank!"); if(strval(newpass) < 0) return SendClientMessage(playerid, COLOR_GREY, "Don't leave the line called 'newpass' blank!"); if(strcmp(oldpass, pInfo[playerid][Pass], true) != 0) return SendClientMessage(playerid, COLOR_GREY, "That is not your oldpassword!"); INI_WriteInt(file, "Pass", udb_hash(newpass)); INI_Close(file); return 1; }
'/changepass 0913456373 iloveyou'
it says "That is not your oldpass!"
maybe this is because my saving system is hasing my password?
i use dudb to hash my password
|
udb_hash ? Then change
Код:
if(strcmp(oldpass, pInfo[playerid][Pass], true) != 0) return SendClientMessage(playerid, COLOR_GREY, "That is not your oldpassword!");
with
Код:
if(strcmp(udb_hash(oldpass), pInfo[playerid][Pass], true) != 0) return SendClientMessage(playerid, COLOR_GREY, "That is not your oldpassword!");
Re: Setting for Player Health to 99 good idea? -
RollTi - 19.04.2012
Код:
argument type mismatch (argument 1)
not so being copy/paster i'm trying all my best to fix it my self