Problem with heli blades kill
#1

So,i've maked this code to reward the player that kill another player with blade and gets 2500$ as bonus:

pawn Код:
if (GetPlayerState(killerid) == PLAYER_STATE_DRIVER)
                {
                    switch(GetVehicleModel(GetPlayerVehicleID(killerid)))
                    {
                        if (killerid != INVALID_PLAYER_ID)
                        {
                        switch (reason)
                            {
                        case 417, 425, 447, 465, 469, 487, 488, 497, 501, 548, 563: reasonMsg = "Helicopter Blades";
                        default: reasonMsg = "Vehicle Collision";
                        SendClientMessage(killerid,COLOR_GREEN,"**You got 2500$ bonus for killing with helicopter blades!");
                        GivePlayerMoney(killerid, 2500);
                    }
                }
            }
        }
But when i compile i get tons of general errors.

What's wrong?

P.S. I placed this in OnPlayerDeath.
Reply
#2

Let's make it like this:
pawn Код:
if(reason == 50) // 50 = heli blades kill
{
    reasonMsg = "Helicopter Blades";
    SendClientMessage(killerid,COLOR_GREEN,"**You got 2500$ bonus for killing with helicopter blades!");
    GivePlayerMoney(killerid, 2500);
}
else if(reason == 49) // 49 = veh collision
{
    reasonMsg = "Vehicle Collision";
}
Reply
#3

pawn Код:
error 017: undefined symbol "reasonMsg"
epic
Reply
#4

Huh, I thought that you already have this variable declared. Anyway, put this above that code:
pawn Код:
new reasonMsg[32];
Reply
#5

Thanks :3
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)