SOLVED
#1

hi, I have a little problem with my script..


I was making random death messages for my server..

So i wasn't realy sure what to do.


So i done this

Код:
public OnPlayerDeath(playerid, killerid, reason)
{  switch(reason)
	{
	  case 0: GameTextForPlayer(playerid,"~W~lol You got owned!",4000,1);
	  case 1: GameTextForPlayer(playerid,"~R~hahah you died!!!",4000,0);
	  case 2: GameTextForPlayer(playerid,"~w~ WASTED!",4000,2);
	}
	return 1;
}
But it didn't work

Anyone no whats wrong?


Xtreme
Reply
#2

the 'reason' is usually the weapon you got killed with.

https://sampwiki.blast.hk/wiki/OnPlayerDeath
Reply
#3

Quote:
Originally Posted by Hiddos
the 'reason' is usually the weapon you got killed with.

https://sampwiki.blast.hk/wiki/OnPlayerDeath

EDIT:

Sorry that wasn't very clear.

What i was trying to make is random

messages for when the player dies.

Did you see my code?
Reply
#4

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{  switch(random(3))
    {
      case 0: GameTextForPlayer(playerid,"~W~lol You got owned!",4000,1);
      case 1: GameTextForPlayer(playerid,"~R~hahah you died!!!",4000,0);
      case 2: GameTextForPlayer(playerid,"~w~ WASTED!",4000,2);
    }
    return 1;
}
If it doesn't works:

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{  
    new rand = random(3);
    switch(rand)
    {
      case 0: GameTextForPlayer(playerid,"~W~lol You got owned!",4000,1);
      case 1: GameTextForPlayer(playerid,"~R~hahah you died!!!",4000,0);
      case 2: GameTextForPlayer(playerid,"~w~ WASTED!",4000,2);
    }
    return 1;
}
If it still doesn't worK:

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{  
    new rand = random(3);
     if(rand == 0) GameTextForPlayer(playerid,"~W~lol You got owned!",4000,1);
     if(rand == 1) GameTextForPlayer(playerid,"~R~hahah you died!!!",4000,0);
     if(rand == 2) GameTextForPlayer(playerid,"~w~ WASTED!",4000,2);
    return 1;
}
Reply
#5

Quote:
Originally Posted by Hiddos
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{  switch(random(3))
    {
      case 0: GameTextForPlayer(playerid,"~W~lol You got owned!",4000,1);
      case 1: GameTextForPlayer(playerid,"~R~hahah you died!!!",4000,0);
      case 2: GameTextForPlayer(playerid,"~w~ WASTED!",4000,2);
    }
    return 1;
}
If it doesn't works:

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{  
    new rand = random(3);
    switch(rand)
    {
      case 0: GameTextForPlayer(playerid,"~W~lol You got owned!",4000,1);
      case 1: GameTextForPlayer(playerid,"~R~hahah you died!!!",4000,0);
      case 2: GameTextForPlayer(playerid,"~w~ WASTED!",4000,2);
    }
    return 1;
}
If it still doesn't worK:

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{  
    new rand = random(3);
     if(rand == 0) GameTextForPlayer(playerid,"~W~lol You got owned!",4000,1);
     if(rand == 1) GameTextForPlayer(playerid,"~R~hahah you died!!!",4000,0);
     if(rand == 2) GameTextForPlayer(playerid,"~w~ WASTED!",4000,2);
    return 1;
}
Thanks, I'll test them.

And are tell you if they worked or not.
Reply
#6

Second one worked.

Thanks..

Reply
#7

Enjoy it

Feel free to ask for more help. Just do me a favor and don't PM me ^^
Reply
#8

Quote:
Originally Posted by Hiddos
Enjoy it

Feel free to ask for more help. Just do me a favor and don't PM me ^^
Lol, I know how Begging scripting request PMs feel. ^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)