15.08.2010, 23:01
I cant get this to work, i have test some other code with no success.
What im trying to do is that if YOU are in a vehicle, and your enemy also is IN a vehicle YOU get +1 in score for killng him. and same if YOUR not in a vehicle and your enemy IS in a vehicle you also get +1 in score for killing him, you understand what i mean? right now you only get +1 score if you kill a enemy who is NOT in a vehicle with YOUR vehicle, or if none is in a vehicle :S
Код:
public OnPlayerDeath(playerid, killerid, reason) { if(IsPlayerInAnyVehiclekillerid)) { SetPlayerScore(killerid, GetPlayerScore(killerid)+1); } else { new cadena[256]; new name[MAX_PLAYER_NAME]; new name2[MAX_PLAYER_NAME]; new Float:px,Float:py,Float:pz; GetPlayerPos(playerid, px, py, pz); gPlayerSpawned[playerid] = 0; GetPlayerName(playerid, name, sizeof(name)); GetPlayerName(killerid, name2, sizeof(name2)); SendDeathMessage(killerid, playerid, reason); if(PlayerInfo[playerid][pGang] != PlayerInfo[killerid][pGang]) PlayerInfo[killerid][pKills] += 1; PlayerInfo[playerid][pDeaths] += 1; format(cadena,255,"%s killed %s",name2,name); SendClientMessageToAll(COLOR_NICERED, cadena); } return 1; }