SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 16/04/2010, 11:49 PM   #1
XRVX
High-roller
 
Join Date: Aug 2009
Posts: 1,141
Reputation: 9
Default [SOLVED] The command doesn't give everyone a point!

pawn Code:
dcmd_pointall(playerid,params[])
{
    #pragma unused params
    if(AccData[playerid][Level]>=4)
    {
        for(new x=0; x<MAX_PLAYERS; x++)
        {
            Points[x]++;
            new po[MAX_PLAYER_NAME+45];
            format(po,sizeof(po),"* Admin %s (ID:%d) gave everyone a point!",PlayerName(playerid),playerid);
            SendClientMessageToAll(COLOR_LIGHTGREEN,po);
            GameTextForAll("~g~Free points~n~for everyone!",3000,5);
            return 1;
        }
    }
    return 1;
}



No errors or warning, but noone gets the points
XRVX is offline  
Old 17/04/2010, 02:01 AM   #2
AK47317
Huge Clucker
 
AK47317's Avatar
 
Join Date: Jan 2010
Location: Pahang, Malaysia
Posts: 245
Reputation: 8
Default Re: The command doesn't give everyone a point!

is it a point or a score?
AK47317 is offline  
Old 17/04/2010, 02:22 AM   #3
mansonh
Gangsta
 
Join Date: Jun 2009
Posts: 602
Reputation: 0
Default Re: The command doesn't give everyone a point!

You exited in your for loop, meaning you only did player 0 then exited.

You also tried to send a client message to all players, for every player in the loop.


pawn Code:
dcmd_pointall(playerid,params[])
{
    #pragma unused params
    if(AccData[playerid][Level]>=4)
    {
        new po[MAX_PLAYER_NAME+45];
        format(po,sizeof(po),"* Admin %s (ID:%d) gave everyone a point!",PlayerName(playerid),playerid);
        SendClientMessageToAll(COLOR_LIGHTGREEN,po);
        GameTextForAll("~g~Free points~n~for everyone!",3000,5);
        for(new x=0; x<MAX_PLAYERS; x++)
        {
            Points[x]++;   
        }

    }
    return 1;
}
__________________
mansonh is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[HELP] Give race point ArTisT Help Archive 1 06/05/2010 01:33 PM
[SOLVED] Point in range of point. CaHbKo Help Archive 3 01/02/2010 01:04 PM
Red Check Point ID? (Solved) DeltaAirlines12 Help Archive 2 27/09/2009 04:59 PM
How to give 1 point every minute? ThePS3Guy Help Archive 7 07/08/2009 04:57 AM


All times are GMT. The time now is 08:02 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.