What's wrong with this script?
#1

I wanted to create achievements for my racing gamemode .
pawn Код:
OnPlayerUpdate(playerid)
{
    new string[100];
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pname,sizeof(pname));
    if(GetPlayerScore(playerid) >=100)
    {
    format(string,sizeof(string),"%s reached 100 score and received 100,000$",pname);
    SendClientMessageToAll(COLOR_LIGHTBLUE,string);
    GivePlayerMoney(playerid, 100000);
    }
    if(GetPlayerScore(playerid) >=250)
    {
    format(string,sizeof(string),"%s reached 250 score and received 250,000$",pname);
    SendClientMessageToAll(COLOR_LIGHTBLUE,string);
    GivePlayerMoney(playerid, 250000);
    }
    if(GetPlayerScore(playerid) >=500)
    {
    format(string,sizeof(string),"%s reached 500 score and received 500,000$,and VIP status",pname);
    SendClientMessageToAll(COLOR_LIGHTBLUE,string);
    GivePlayerMoney(playerid, 500000);
    }
    if(GetPlayerScore(playerid) >=1000)
    {
    format(string,sizeof(string),"%s reached 1000 score and received 1,000,000$",pname);
    SendClientMessageToAll(COLOR_LIGHTBLUE,string);
    GivePlayerMoney(playerid, 1000000);
    }
    if(GetPlayerScore(playerid) >=2500)
    {
    format(string,sizeof(string),"%s reached 250 score and received 2,500,000$",pname);
    SendClientMessageToAll(COLOR_LIGHTBLUE,string);
    GivePlayerMoney(playerid, 2500000);
    }
    if(GetPlayerScore(playerid) >=5000)
    {
    format(string,sizeof(string),"%s reached 500 score and received 5,000,000$",pname);
    SendClientMessageToAll(COLOR_LIGHTBLUE,string);
    GivePlayerMoney(playerid, 250000);
    }
    if(GetPlayerScore(playerid) >=10000)
    {
    format(string,sizeof(string),"%s reached 10000 score and received 10,000,000%",pname);
    SendClientMessageToAll(COLOR_LIGHTBLUE,string);
    GivePlayerMoney(playerid, 10000000);
    }
        return 1;
}
pawn Код:
CMD:achievements(playerid,params[])
{
    //SendClientMessage(playerid,COLOR_RED,"This page is under construction");
    ShowPlayerDialog(playerid, 95, DIALOG_STYLE_MSGBOX, "Achievement Menu","Achievement - Reward - Special\n100 score - 100,000$\n 250 score - 250,000$ 500 score - 500,000 - VIP\n 1000 score - 1,000,000$\n 2500 score - 2,500,000$\n5000 score - 5,000,000$\n 10000 score - 10,000,000","OK","");
    return 1;
}
I dont know whats wrong but when someone reaches 100 score,the chat is being spammed by the custom messages and he receives his money more than he should to.
Reply


Messages In This Thread
What's wrong with this script? - by Johnson_Brooks - 29.08.2012, 15:50
Re: What's wrong with this script? - by Mr.Anonymous - 29.08.2012, 16:32
Re: What's wrong with this script? - by Zaila - 29.08.2012, 16:32
Re: What's wrong with this script? - by HuSs3n - 29.08.2012, 16:35
Re: What's wrong with this script? - by Johnson_Brooks - 29.08.2012, 17:16
Re: What's wrong with this script? - by ThePrograme - 29.08.2012, 18:25
Re: What's wrong with this script? - by Johnson_Brooks - 29.08.2012, 18:53
Re: What's wrong with this script? - by Misiur - 29.08.2012, 19:17
Re: What's wrong with this script? - by Johnson_Brooks - 29.08.2012, 20:37
Re: What's wrong with this script? - by Roko_foko - 29.08.2012, 20:49

Forum Jump:


Users browsing this thread: 1 Guest(s)