Kills,Deaths,Ratio,killing spree (""textdraw"" in dm)
#1

Kills:3
Deaths:2
Killingspree:1
Ratio:1.50

Here is the code, but I want to update it (textdrawsetstring) in (onplayerdeath).....

Code:
Код:
new Text:Textdraw0;
new Text:Textdraw1;
new Text:Textdraw2;
new Text:Textdraw3;
new Text:Textdraw4;


Textdraw0 = TextDrawCreate(391.176483, 319.416687, "Box");
TextDrawLetterSize(Textdraw0, 0.000000, 7.461111);
TextDrawTextSize(Textdraw0, 260.588226, 0.000000);
TextDrawAlignment(Textdraw0, 1);
TextDrawColor(Textdraw0, 0);
TextDrawUseBox(Textdraw0, true);
TextDrawBoxColor(Textdraw0, 102);
TextDrawSetShadow(Textdraw0, 0);
TextDrawSetOutline(Textdraw0, 0);
TextDrawFont(Textdraw0, 0);

Textdraw1 = TextDrawCreate(265.882415, 317.333282, "Kills:");
TextDrawLetterSize(Textdraw1, 0.449999, 1.600000);
TextDrawAlignment(Textdraw1, 1);
TextDrawColor(Textdraw1, -1);
TextDrawSetShadow(Textdraw1, 0);
TextDrawSetOutline(Textdraw1, 1);
TextDrawBackgroundColor(Textdraw1, 51);
TextDrawFont(Textdraw1, 1);
TextDrawSetProportional(Textdraw1, 1);

Textdraw2 = TextDrawCreate(265.882293, 334.833312, "Deaths:");
TextDrawLetterSize(Textdraw2, 0.449999, 1.600000);
TextDrawAlignment(Textdraw2, 1);
TextDrawColor(Textdraw2, -1);
TextDrawSetShadow(Textdraw2, 0);
TextDrawSetOutline(Textdraw2, 1);
TextDrawBackgroundColor(Textdraw2, 51);
TextDrawFont(Textdraw2, 1);
TextDrawSetProportional(Textdraw2, 1);

Textdraw3 = TextDrawCreate(265.411743, 350.583312, "Killingspree:");
TextDrawLetterSize(Textdraw3, 0.449999, 1.600000);
TextDrawAlignment(Textdraw3, 1);
TextDrawColor(Textdraw3, -1);
TextDrawSetShadow(Textdraw3, 0);
TextDrawSetOutline(Textdraw3, 1);
TextDrawBackgroundColor(Textdraw3, 51);
TextDrawFont(Textdraw3, 1);
TextDrawSetProportional(Textdraw3, 1);

Textdraw4 = TextDrawCreate(265.882354, 366.916778, "Ratio:");
TextDrawLetterSize(Textdraw4, 0.449999, 1.600000);
TextDrawAlignment(Textdraw4, 1);
TextDrawColor(Textdraw4, -1);
TextDrawSetShadow(Textdraw4, 0);
TextDrawSetOutline(Textdraw4, 1);
TextDrawBackgroundColor(Textdraw4, 51);
TextDrawFont(Textdraw4, 1);
TextDrawSetProportional(Textdraw4, 1);

OnPlayerDeath:

Код:
	if(DM[playerid] > 0)
 	{
		SetPlayerScore(killerid,GetPlayerScore(killerid)+2);
		SetPlayerHealth(killerid,100);
		GivePlayerMoney(killerid,0,2000);
		return true;
	}
/dm1

Код:
    if (strcmp("/dm1", cmdtext, true, 10) == 0)
    {
		dm1players++;
		SetScoreData();
		ResetPlayerWeapons(playerid);
		new dm1spawn = random(6);
		SetPlayerPos(playerid,  RandomDM1Spawns[dm1spawn][0],RandomDM1Spawns[dm1spawn][1],RandomDM1Spawns[dm1spawn][2]);
		SetPlayerFacingAngle(playerid,RandomDM1Spawns[dm1spawn][3]);
		SetPlayerVirtualWorld(playerid,88);
		TogglePlayerControllable(playerid,true);
		SetPlayerInterior(playerid,0);
		GivePlayerWeapon(playerid,16,9999);
		GivePlayerWeapon(playerid,35,9999);
		SetPlayerHealth(playerid,100);
		return true;
	}
/exitdm


Код:
   if (strcmp("/exitdm", cmdtext, true, 10) == 0)
    	{
        new PlayerName[24];
        GetPlayerName(playerid,PlayerName,sizeof(PlayerName));
		AccountInfo[playerid][DMLeft] = 1;
		if(DM[playerid] == 1)
			{
			dm1players--;
			SetScoreData();
		       SetPlayerVirtualWorld(playerid,0);
			ResetPlayerWeapons(playerid);
			SpawnPlayer(playerid);
 			DM[playerid] = 0;
			return true;
			}
                }
Reply
#2

you use general textdraw, use
https://sampwiki.blast.hk/wiki/CreatePlayerTextDraw
also as I saw trhough your script all stuff is close,why you not use one textdraw? than that a lot of it
in setting string use ~n~ (new line) ~r~ ( red ) etc, also to update string check this
https://sampwiki.blast.hk/wiki/PlayerTextDrawSetString
Reply
#3

Ok but help me with TextDrawSetString, and with player kills and deahts...
Reply
#4

exemple death,
pawn Код:
new PlayerText:PlayerStatus[MAX_PLAYERS];
public OnPlayerDeath(killerid,playerid,reason[])
{
          Death[playerid]++;
          Kills[killerid]++;
          new str[128];
          format(str,128,"Deaths:%d ~n~Kills:%d",Death[playerid],Kills[playerid]);
          PlayerTextDrawSetString(playerid,PlayerStatus[playerid],str);
          format(str,128,"Deaths:%d ~n~Kills:%d",Death[killerid],Kills[killerid]);
          PlayerTextDrawSetString(killerid,PlayerStatus[killerid],str);
          return 1;
}
don't forget to create player's textdraw on player connect and destroy it when he is disconnecting
Reply
#5

i get this

Код:
error 017: undefined symbol "Death"
warning 215: expression has no effect
error 001: expected token: ";", but found "]"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#6

No one help?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)