01.05.2013, 17:25
hi ,
i have this code
public OnPlayerDeath(playerid, killerid, reason)
{
LooseWeapons(playerid);
new weaponid;
if(killerid != INVALID_PLAYER_ID) // Valid killer, give cash+score
{
if(killerid != INVALID_PLAYER_ID && reason == 34)
{
GameTextForPlayer(killerid,"~r~~h~~h~You made a Sniper Kill~n~~w~+2 Scores~n~~g~+3000$",5000,3);
GivePlayerMoney(killerid,3000);
SetPlayerScore(killerid,GetPlayerScore(killerid)+2 );
}
if( killerid != INVALID_PLAYER_ID && reason==51 && GetPlayerVehicleID(playerid)==520)//Hydra
{
GameTextForPlayer(killerid,"~r~~h~~h~You made a Hydra Kill~n~~w~+5 Scores~n~~g~+5000$",5000,3);
GivePlayerMoney(killerid,5000);
SetPlayerScore(killerid,GetPlayerScore(killerid)+5 );
return 1;
}
if(killerid != INVALID_PLAYER_ID && reason==51 && GetPlayerVehicleID(playerid)==432) //rhino
{
GameTextForPlayer(killerid,"~r~~h~~h~You made a Rhino Kill~n~~w~+4 Scores~n~~g~+4000$",5000,3);
GivePlayerMoney(killerid,5000);
SetPlayerScore(killerid,GetPlayerScore(killerid)+4 );
return 1;
}
if(killerid != INVALID_PLAYER_ID && reason==31 && GetPlayerVehicleID(playerid)==476)//Rustler or w/e
{
GameTextForPlayer(killerid,"~r~~h~~h~You made a Rustler Kill~n~~w~+3 Scores~n~~g~+3000$",5000,3);
GivePlayerMoney(killerid,3000);
SetPlayerScore(killerid,GetPlayerScore(killerid)+3 );
return 1;
}
if(killerid != INVALID_PLAYER_ID && reason==31 && GetPlayerVehicleID(playerid)==425)//Hunter
{
GameTextForPlayer(killerid,"~r~~h~~h~You made a Hunter kill~n~~w~+6 Scores~n~~g~+3000$",5000,3);
GivePlayerMoney(killerid,3000);
SetPlayerScore(killerid,GetPlayerScore(killerid)+6 );
return 1;
}
if(killerid != INVALID_PLAYER_ID && reason==31 && GetPlayerVehicleID(playerid)==447)//Sparrow
{
GameTextForPlayer(killerid,"~r~~h~~h~You made a Sparrow kill~n~~w~+2 Scores~n~~g~+2000$",5000,3);
GivePlayerMoney(killerid,2000);
SetPlayerScore(killerid,GetPlayerScore(killerid)+2 );
return 1;
}
}
// Shows the kill in the killfeed/deathlog/death window
Streaks[killerid] ++;
GivePlayerMoney(killerid, -100);
GameTextForPlayer(playerid,"~r~-100m",5000,5);//the sign '++' means, increase the variable for the killerid by 1//if like, give the killer some money, else comment this line out
now , when someone kill player with any of these vehicles he don't get score ,and text not showed pls help
i have this code
public OnPlayerDeath(playerid, killerid, reason)
{
LooseWeapons(playerid);
new weaponid;
if(killerid != INVALID_PLAYER_ID) // Valid killer, give cash+score
{
if(killerid != INVALID_PLAYER_ID && reason == 34)
{
GameTextForPlayer(killerid,"~r~~h~~h~You made a Sniper Kill~n~~w~+2 Scores~n~~g~+3000$",5000,3);
GivePlayerMoney(killerid,3000);
SetPlayerScore(killerid,GetPlayerScore(killerid)+2 );
}
if( killerid != INVALID_PLAYER_ID && reason==51 && GetPlayerVehicleID(playerid)==520)//Hydra
{
GameTextForPlayer(killerid,"~r~~h~~h~You made a Hydra Kill~n~~w~+5 Scores~n~~g~+5000$",5000,3);
GivePlayerMoney(killerid,5000);
SetPlayerScore(killerid,GetPlayerScore(killerid)+5 );
return 1;
}
if(killerid != INVALID_PLAYER_ID && reason==51 && GetPlayerVehicleID(playerid)==432) //rhino
{
GameTextForPlayer(killerid,"~r~~h~~h~You made a Rhino Kill~n~~w~+4 Scores~n~~g~+4000$",5000,3);
GivePlayerMoney(killerid,5000);
SetPlayerScore(killerid,GetPlayerScore(killerid)+4 );
return 1;
}
if(killerid != INVALID_PLAYER_ID && reason==31 && GetPlayerVehicleID(playerid)==476)//Rustler or w/e
{
GameTextForPlayer(killerid,"~r~~h~~h~You made a Rustler Kill~n~~w~+3 Scores~n~~g~+3000$",5000,3);
GivePlayerMoney(killerid,3000);
SetPlayerScore(killerid,GetPlayerScore(killerid)+3 );
return 1;
}
if(killerid != INVALID_PLAYER_ID && reason==31 && GetPlayerVehicleID(playerid)==425)//Hunter
{
GameTextForPlayer(killerid,"~r~~h~~h~You made a Hunter kill~n~~w~+6 Scores~n~~g~+3000$",5000,3);
GivePlayerMoney(killerid,3000);
SetPlayerScore(killerid,GetPlayerScore(killerid)+6 );
return 1;
}
if(killerid != INVALID_PLAYER_ID && reason==31 && GetPlayerVehicleID(playerid)==447)//Sparrow
{
GameTextForPlayer(killerid,"~r~~h~~h~You made a Sparrow kill~n~~w~+2 Scores~n~~g~+2000$",5000,3);
GivePlayerMoney(killerid,2000);
SetPlayerScore(killerid,GetPlayerScore(killerid)+2 );
return 1;
}
}
// Shows the kill in the killfeed/deathlog/death window
Streaks[killerid] ++;
GivePlayerMoney(killerid, -100);
GameTextForPlayer(playerid,"~r~-100m",5000,5);//the sign '++' means, increase the variable for the killerid by 1//if like, give the killer some money, else comment this line out
now , when someone kill player with any of these vehicles he don't get score ,and text not showed pls help