25.05.2014, 21:30
Hello, I'm hoping to start scripting... I want to learn but I'm not sure exactly where to start. It all looks like a lot right now. Any advice or help?
CMD:heal(playerid, params[])
{
new string[128], lookupid, pname[25], name[25];
if(sscanf(params, "ui", lookupid))
{
format(string, sizeof (string), "* Usage: /heal (id/name).");
SendClientMessage(playerid, 0xFFFF00FF, string);
return 1;
}
GetPlayerName(playerid, pname, sizeof(pname));
GetPlayerName(lookupid, name, sizeof(name));
SetPlayerHealth(lookupid, 100);
format(string, sizeof (string), "* You've healed %s (%d)!", name, lookupid);
SendClientMessage(playerid, 0xFFFF00FF, string);
format(string, sizeof (string), "* %s (%d) has healed you!", pname, playerid);
SendClientMessage(lookupid, 0xFFFF00FF, string);
return 1;
}
You can read the sa-mp wiki by clicking on the following link: https://sampwiki.blast.hk/, everything you need to know about pawn is there.
Also keep in mind that creativity is all you need to be a great scripting. I'll suggest you to use zcmd and sscanf to code commands as its really easy and kinda fun also: Example: pawn Код:
ZCMD: https://sampforum.blast.hk/showthread.php?tid=91354. Good luck! |