22.09.2009, 03:10
i just started to understand sscanf and i was wondering
https://sampwiki.blast.hk/wiki/Fast_Comm...mple_revisited
from this example i put in a script
i tested ingame with friend and /heal always resulted to id 0
how can this be?, and how can i fix this?
sorry if u don't understand my typing
Thanks
https://sampwiki.blast.hk/wiki/Fast_Comm...mple_revisited
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { dcmd(heal, 4, cmdtext); return 0; } dcmd_heal(playerid, params[]) { new id; if (sscanf(params, "u", id)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/heal <playerid>\""); else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "Player not found"); else { SetPlayerHealth(id, 100.0); SendClientMessage(id, 0x00FF00AA, "You have been healed"); SendClientMessage(playerid, 0x00FF00AA, "Player healed"); } return 1; }
i tested ingame with friend and /heal always resulted to id 0
how can this be?, and how can i fix this?
sorry if u don't understand my typing
Thanks