SA-MP Forums Archive
Point per kill. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Point per kill. (/showthread.php?tid=152844)



Point per kill. - Ozwell_Spencer - 06.06.2010

I need a simple script that gives a player a point after every kill they get.


Re: Point per kill. - [HiC]TheKiller - 06.06.2010

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
  SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
  return 1;
}
Wasn't that easy?


Re: Point per kill. - Ozwell_Spencer - 06.06.2010

Quote:
Originally Posted by [HiC
TheKiller ]
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
  SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
  return 1;
}
Wasn't that easy?
Yes, but I am a noob scripter. Thanks, anyway, it works.


Re: Point per kill. - Ozwell_Spencer - 06.06.2010

You seem to know what you're doing could you show me how to get text over the skin when in the character selection screen?
pawn Код:
AddPlayerClass(283,1709.1407,745.4641,12.6843,103.9314,27,50,31,150,35,10); // ARMY/COPS
    AddPlayerClass(281,1709.1407,745.4641,12.6843,103.9314,27,50,31,150,35,10); // ARMY/COPS
    AddPlayerClass(288,1709.1407,745.4641,12.6843,103.9314,27,50,31,150,35,10); // ARMY/COPS
    AddPlayerClass(282,1709.1407,745.4641,12.6843,103.9314,27,50,31,150,35,10); // ARMY/COPS
    AddPlayerClass(285,1709.1407,745.4641,12.6843,103.9314,27,50,31,150,35,10); // ARMY/COPS
    AddPlayerClass(280,1709.1407,745.4641,12.6843,103.9314,27,50,31,150,35,10); // ARMY/COPS
    AddPlayerClass(284,1709.1407,745.4641,12.6843,103.9314,27,50,31,150,35,10); // ARMY/COPS
    AddPlayerClass(286,1709.1407,745.4641,12.6843,103.9314,27,50,31,150,35,10); // ARMY/COPS
    AddPlayerClass(287,1709.1407,745.4641,12.6843,103.9314,27,50,31,150,35,10); // ARMY/COPS
Over their heads I want it to say "Containment Crew". If you know how to.


Re: Point per kill. - Kar - 06.06.2010

ik how to get the text below-right side but idk how to get it above.


Re: Point per kill. - Ozwell_Spencer - 06.06.2010

Well anywhere, just somewhere where it says "Containment Crew".


Re: Point per kill. - [HiC]TheKiller - 06.06.2010

Because I don't know if they are all your classes, I'll do it like this:

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
  new s = GetPlayerSkin(playerid);
  if(s == 283 || s == 281 || s == 288 || s == 285 || s == 280 || s == 284 || s == 286 || s == 287)
  {
    GameTextForPlayer(playerid, "~g~Containment Crew", 2000, 3);
  }
  return 1;
}




Re: Point per kill. - Antonio [G-RP] - 06.06.2010

Quote:
Originally Posted by [HiC
TheKiller ]
Because I don't know if they are all your classes, I'll do it like this:

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
  new s = GetPlayerSkin(playerid);
  if(s == 283 || s == 81 || s == 288 || s == 285 || s == 280 || s == 284 || s == 286 || s == 287)
  {
    GameTextForPlayer(playerid, "~g~Containment Crew", 2000, 3);
  }
  return 1;
}

Missed one..

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
  new s = GetPlayerSkin(playerid);
  if(s == 283 || s == 281 || s == 288 || s == 285 || s == 280 || s == 284 || s == 286 || s == 287)
  {
    GameTextForPlayer(playerid, "~g~Containment Crew", 2000, 3);
  }
  return 1;
}



Re: Point per kill. - Kar - 06.06.2010

does that put the game text above player's head?


Re: Point per kill. - [HiC]TheKiller - 06.06.2010

Quote:
Originally Posted by Kar
does that put the game text above player's head?
No, it shows text on the screen on OnPlayerRequestClass. You are looking for https://sampwiki.blast.hk/wiki/CreatePlayer3DTextLabel