Player id number
#1

Hey, i am learning to script and i am just wondering how to get a players id number, i am makin a script that has a /heal <playerid> command, and when u type it i want some text to come up on the player who got healed saying 'You have been healed by <player name>' if you understand me?

lol :S if its not clear enough then i will make it clearer for ya

please reply quick cause i havnt got much time

cheers

HeadShot
Reply
#2

Simple example using dcmd and sscanf, a great combination for making commands

pawn Код:
dcmd_heal(playerid,params[])
{
  if(sscanf(params,"i",strval(params))) SendClientMessage(playerid,red,"Usage: /heal <playerid>");
  else
  {
    if(!IsPlayerConnected(strval(params))) return SendClientMessage(playerid,red,"Error, player not found!");
    SetPlayerHealth(strval(params),100);
    format(string,sizeof(string),"You have been healed by %s",PlayerName(strval(params)));
    SendClientMessage(strval(params),red,string);
  }
  return 1;
}
Hope that helps.

Note, you will need to define certain things to make this work with your script, this is merely an example to get you started
Reply
#3

thanks

looks helpful
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)