Problem with heli blades kill - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem with heli blades kill (
/showthread.php?tid=308762)
Problem with heli blades kill -
Face9000 - 05.01.2012
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.
Re: Problem with heli blades kill -
Norck - 05.01.2012
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";
}
Re: Problem with heli blades kill -
Face9000 - 05.01.2012
pawn Код:
error 017: undefined symbol "reasonMsg"
epic
Re: Problem with heli blades kill -
Norck - 05.01.2012
Huh, I thought that you already have this variable declared. Anyway, put this above that code:
Re: Problem with heli blades kill -
Face9000 - 05.01.2012
Thanks :3