View Single Post
Old 15/12/2010, 05:11 PM   #5
Marcel
Huge Clucker
 
Join Date: Nov 2007
Posts: 382
Reputation: 2
Default Re: HappyHour problem!!

pawn Code:
forward HappyH();

public OnGameModeInit ()
{

SetTimer("HappyH",240000,true);

return 1;
}


new const ValidWeapons[22][2] =
{
    {22, 200}, //9mm
    {23, 150},//9mmsilenced
    {24, 100},//DEagle
    {25, 150},//Shotgun
    {26, 150},//ShawnOFF
    {18, 4},//Molotov
    {16, 4},//Grenade
    {27, 150},//CombatShotgun
    {28, 200},//MicroSmg
    {9, 0},//Chainsaw
    {29, 200}, //MP5
    {30, 250},//AK47
    {31, 250},//M4
    {32, 200},//Tec9
    {33, 100},//CountryRifle
    {34, 100},//SniperRifle
    {35, 15},//RocketLauncher
    {37, 600},//Flamethrower
    {38, 500},//Minigun
    {10, 0},//PDildo
    {8, 0},//Katana
    {4, 0}//Knife
};


public HappyH()
{
        new players;
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
                if(IsPlayerConnected(i))
                {
                        players++;
                }
        }
    new player = random(players);
        new r = random(sizeof(ValidWeapons));
        GivePlayerWeapon(player, ValidWeapons[r][0], ValidWeapons[r][1]);
        SendClientMessage(player,0xFF66FFAA, "Happy Hour!! You've got a random weapon gift!");
        new name[ 24 ], string[ 64 ];
        GetPlayerName( player, name, 24 );
        format( string, sizeof(string), "~p~%s has got a random weapon gift!!", name );
        GameTextForAll( string, 5000, 5 );
    GivePlayerMoney(player,2000);
    return 1;
}
Marcel is offline