GiveAllScore does NOT give score to players
#3

Without any explaination more ?

Also, this code is clearer and looks better.

PHP код:

CMD
:giveallscore(playerid,params[])
{
    if(!
IsPlayerConnected(playerid)) return 1;
    if(
admin(playerid) < 3) return message(playerid,"~b~ADMIN: ~w~~h~Access denied, You don't have privillage to this command.",5000),SendClientMessage(playerid,COLOR_MAROON,"(admin) Access denied, You don't have privillage to this command.");
    new 
ammount;
    if(
sscanf(params"i"ammount)) return SendClientMessage(playeridCOLOR_MAROON,"(admin) /Giveallscore (ammount)."),message(playerid,"~b~ADMIN: ~w~~h~Correct usage: /Giveallscore (ammount).",5000);
    new 
string[145];
    
sendadmincmd(playerid,"GIVEALLSCORE");
    
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
    
format(string144,"(admin) You have given all players score %d.",ammount);
    
SendClientMessage(playerid,COLOR_ORANGERED,string);
    
format(string,144,"~b~ADMIN: ~w~~h~You have given all players score %d.",ammount);
    
message(playerid,string,5000);
    for(new 
i;i<MAX_PLAYERS;i++)
    {
        if(
IsPlayerConnected(i))
        {
            
format(string,144,"(admin) Administrator ''%s(%d)'' have given all players  score %d.",pNick(playerid),playerid,ammount);
            
SendClientMessage(i,COLOR_ORANGERED,string);
            
PlayerPlaySound(i,1057,0.0,0.0,0.0);
            
format(string,140,"~b~ADMIN: ~w~~h~Administrator ''%s(%d)'' have given all players score %d.",pNick(playerid),playerid,ammount);
            
message(i,string,5000);
            switch(
random(5))
            {
                case 
0PlayerInfo[i][dmscore]++;
                case 
1PlayerInfo[i][racescore]++;
                case 
2PlayerInfo[i][timescore]++;
                case 
3PlayerInfo[i][groupscore]++;
                case 
4PlayerInfo[i][duelscore]++;
                default: 
PlayerInfo[i][dmscore]++;
            }
            
SetPlayerScore(i,GetPlayerScore(i)+ammount);
        }
    }
    return 
1;

I've added a "default" case in the switch, replace what it does by whatever you want, and also, what doesn't work ?
Reply


Messages In This Thread
GiveAllScore does NOT give score to players - by iAnonymous - 23.05.2014, 12:33
Re: GiveAllScore does NOT give score to players - by Fred1993 - 23.05.2014, 12:39
Re : GiveAllScore does NOT give score to players - by S4t3K - 23.05.2014, 12:45
Re: GiveAllScore does NOT give score to players - by iAnonymous - 23.05.2014, 12:50

Forum Jump:


Users browsing this thread: 1 Guest(s)