SA-MP Forums Archive
/giveallscore - bug - 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: /giveallscore - bug (/showthread.php?tid=634732)



/giveallscore - bug - RxErT - 25.05.2017

PHP код:
CMD:giveallscore(playerid,params[])
{
    if(
Spawned[playerid] == 0) return SendClientMessage(playerid0xf8f8f8fff,"ERROR: {F00f00}You can't use this command while you are not spawned!");
    if(
PlayerInfo[playerid][pAdmin] >= 5)
    {
    new 
string[128];
    new 
amount;
    new 
pname[MAX_PLAYER_NAME];
    
GetPlayerName(playeridpname,sizeof(pname));
    if(
sscanf(params,"i",amount)) return SCM(playerid0xf8f8f8fff,"Syntax: {f00f00}/giveallscore <amount>");
    if(
amount || amount 900000) return SCM(playerid0xf8f8f8fff,"ERROR: {FFFFFF}900000 is high amount can be used!");
    foreach(
Playeri)
    {
    
SetPlayerScore(GetPlayerScore(i), amount);
    
format(string,sizeof(string),"{ffa700}Administrator {f00f00}%s {ffa700}has given all {f00f00}%d {ffa700}score!",pname,amount);
    
SendClientMessage(i, -1string);
    }
    }
    else
    {
    
SCM(playerid0xf8f8f8fff,"ERROR: {FFFFFF}You aren't authorized to use this command!");
    }
    return 
1;

So it's compile fine but it gives player score just if he's score was 0 if it was atleast 1 nothing happens


Re: /giveallscore - bug - Threshold - 25.05.2017

PHP код:
SetPlayerScore(iGetPlayerScore(i) + amount); 
I would consider learning how to script before actually attempting it...


Re: /giveallscore - bug - RxErT - 25.05.2017

Quote:
Originally Posted by Threshold
Посмотреть сообщение
PHP код:
SetPlayerScore(iGetPlayerScore(i) + amount); 
I would consider learning how to script before actually attempting it...
Thank you, it works fine.


Re: /giveallscore - bug - Coraxx - 07.03.2018

You gave me this code with bug! It's not even saving playerscore in database. -_- You bad friend.


Re: /giveallscore - bug - BulletRaja - 07.03.2018

PHP код:
CMD:giveallscore(playerid,params[]) 

    if(
Spawned[playerid] == 0) return SendClientMessage(playerid0xf8f8f8fff,"ERROR: {F00f00}You can't use this command while you are not spawned!"); 
    if(
PlayerInfo[playerid][pAdmin] >= 5
    { 
    new 
string[128]; 
    new 
amount
    new 
pname[MAX_PLAYER_NAME]; 
    
GetPlayerName(playeridpname,sizeof(pname)); 
    if(
sscanf(params,"i",amount)) return SCM(playerid0xf8f8f8fff,"Syntax: {f00f00}/giveallscore <amount>"); 
    if(
amount || amount 900000) return SCM(playerid0xf8f8f8fff,"ERROR: {FFFFFF}900000 is high amount can be used!"); 
    foreach(
Playeri
    { 
    
//SetPlayerScore(GetPlayerScore(i), amount); 
   
SetPlayerScore(iGetPlayerScore(i) + amount); 
    
format(string,sizeof(string),"{ffa700}Administrator {f00f00}%s {ffa700}has given all {f00f00}%d {ffa700}score!",pname,amount); 
    
SendClientMessage(i, -1string); 
    } 
    } 
    else 
    { 
    
SCM(playerid0xf8f8f8fff,"ERROR: {FFFFFF}You aren't authorized to use this command!"); 
    } 
    return 
1

This would work