receives score when playerid dies in the vehicle per killerid (OnPlayerDeath)
#1

How would I do it? in onplayerdeath...

I've tried with this:

Код:
public OnPlayerDeath(playerid, killerid, reason){
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER){ //this
DateM[killerid][cKills] += 1;
DateM[playerid][cDeaths] += 1;}

if(killerid != INVALID_PLAYER_ID){
DateM[killerid][cKills]+= 1;
switch(DateM[killerid][cKills]){
case 2:{ //2 kills
DateM[killerid][cLevel]++;
SetPlayerScore(killerid, (GetPlayerScore(killerid)+ DateM[killerid][cLevel]));}
}
}
return 1;}
but nothing
Reply
#2

You start using killerid, before you've checked if killerid is invalid... That's a good way to cause your server to crash...

Код:
DateM[killerid][cKills] += 1;
DateM[playerid][cDeaths] += 1;}

if(killerid != INVALID_PLAYER_ID){
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)