SA-MP Forums Archive
What the problem?! - 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)
+--- Thread: What the problem?! (/showthread.php?tid=470425)



What the problem?! - Another1 - 18.10.2013

Код:
CMD:healme(playerid,params[])
{
  if(!IsPlayerAdmin(playerid)) return SCM(playerid, RED, "UnKnown Command! Type /help");
  SetPlayerHealth(playerid, 100.0);
  SetPlayerArmour(playerid, 100.0);
  new h_msg[100];
  format(h_msg,sizeof (h_msg),"Administrator %s has healed you!",pName);
  SCMA(RED, h_msg);
  return 1;
}
PHP код:
C:\Users\John\Desktop\Server\filterscripts\TuNiAdmin.pwn(95) : error 076syntax error in the expression, or invalid function call 



Re: What the problem?! - WLSF - 18.10.2013

Try something normal like this:
pawn Код:
CMD:healme(playeris, params[])
{
    if (IsPlayerAdmin(playerid))
    {
        SetPlayerHealth(playerid, 100.0);
        SetPlayerArmour(playerid, 100.0);
       
        SendClientMessage(playerid, -1, "U got healed.");
    }
    return 1;
}
You're healing yourself, so, you don't need to send a message with your name.


Re: What the problem?! - Another1 - 18.10.2013

Quote:
Originally Posted by Willian_Luigi
Посмотреть сообщение
Try something normal like this:
pawn Код:
CMD:healme(playeris, params[])
{
    if (IsPlayerAdmin(playerid))
    {
        SetPlayerHealth(playerid, 100.0);
        SetPlayerArmour(playerid, 100.0);
       
        SendClientMessage(playerid, -1, "U got healed.");
    }
    return 1;
}
You're healing yourself, so, you don't need to send a message with your name.
i know but what was the problem?


Re: What the problem?! - WLSF - 18.10.2013

Quote:
Originally Posted by Another1
Посмотреть сообщение
i know but what was the problem?
I think you're missing to call correctly the function, Example:

pawn Код:
pName(playerid); //Right
pName //Wrong
Something like this.

@edit

\/ looks down, it can solve your problem.


Re: What the problem?! - PT - 18.10.2013

pawn Код:
CMD:healme(playerid)
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, RED, "UnKnown Command! Type /help");
    SetPlayerHealth(playerid, 100.0);
    SetPlayerArmour(playerid, 100.0);
    new h_msg[100], ptname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, ptname, MAX_PLAYER_NAME);
    format(h_msg,sizeof (h_msg),"Administrator %s has healed you!", ptname);
    SendClientMessageToAll(RED, h_msg);
    return 1;
}