18.11.2011, 15:54
In this tutorial I will show you some simple commands such as heal, kill and tp. Those commands are useful for a beginer scripter and let him learn some of scripting basics. Follow the following steps:
1. Open your server's folder.
2. Go to the "Pawno" folder and run pawno.exe file.
3. Click the folder icon in the pawno and browse your .pwn GM.
4. Hit CTRL + F.
5. A searching tool windown should pop-up. Search for OnPlayerCommandText and do the following:
The end of the tutorial. For any questions feel free to post a comment.
1. Open your server's folder.
2. Go to the "Pawno" folder and run pawno.exe file.
3. Click the folder icon in the pawno and browse your .pwn GM.
4. Hit CTRL + F.
5. A searching tool windown should pop-up. Search for OnPlayerCommandText and do the following:
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp, "/kill", cmd, true, 10) == 0)
{
SetPlayerHealth(playerid, 0);
SendClientMessage(playerid, [COLORHERE], "You died.");
return 1;
}
if(strcmp, "/heal", cmd, true, 10) == 0)
{
GivePlayerMoney(playerid, -100); // Edit the money if you want
SetPlayerHealth(playerid, 100); // You can also edit the health healing here
SendClientMessage(playerid, [COLORHERE], "You have healed yourself for $100.");
return 1;
}
if(strcmp, "/tp", cmd, true, 10) == 0)
{
SetPlayerPos(playerid, [PosX], [PosY], [PosZ]);
SendClientMessage(playerid, [COLORHERE], "You have been teleported.");
return 1;
}
return 0;
}