Player id number
#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


Messages In This Thread
Player id number - by Head$hot - 05.08.2009, 18:02
Re: Player id number - by JaTochNietDan - 05.08.2009, 18:07
Re: Player id number - by Head$hot - 05.08.2009, 18:12

Forum Jump:


Users browsing this thread: 1 Guest(s)