26.01.2011, 12:02
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/heal", cmdtext, true) == 0)
{
if(GetPlayerMoney(playerid) < 300)
{
SendClientMessage(playerid,YELLOW,"[ERROR]: Not enough money!! This costs $300!");
return 1;
}
else
{
SendClientMessage(playerid,YELLOW,"[PLAYER]: Healed for $300!");
SetPlayerHealth(playerid, 100);
GivePlayerMoney (playerid, -300);
return 1;
}
}
if (strcmp("/armour", cmdtext, true) == 0)
{
if(GetPlayerMoney(playerid) < 300)
{
SendClientMessage(playerid,YELLOW,"[ERROR]: Not enough money!!");
return 1;
}
else
{
SendClientMessage(playerid,YELLOW,"[PLAYER]: Armour given for $300!");
SetPlayerArmour(playerid, 100);
GivePlayerMoney (playerid, -300);
return 1;
}
}
if (strcmp("/help", cmdtext, true) == 0)
{
SendClientMessage(playerid,YELLOW,"________________________________________________________________________________________");
SendClientMessage(playerid,YELLOW,"[HELP]: Hello, and welcome to Ultimate Freeroam. This uses a custom script by [UF]Jesco");
SendClientMessage(playerid,YELLOW,"and was created specifically for his first server; Ultimate Freeroam.");
SendClientMessage(playerid,YELLOW,"You can use the command: [/commands] to get a list of commands!");
SendClientMessage(playerid,YELLOW,"________________________________________________________________________________________");
return 1;
}
if (strcmp("/commands", cmdtext, true) == 0)
{
SendClientMessage(playerid,YELLOW,"[COMMANDLIST]: /heal; /armour; /register; /login; /admins; /changelog; /report ");
return 1;
}
if (strcmp("/changelog", cmdtext, true) == 0)
{
SendClientMessage(playerid,YELLOW,"___________________________________________");
SendClientMessage(playerid,YELLOW,"Ultimate Freeroam Script Changelog:");
SendClientMessage(playerid,YELLOW,"< Added a /heal and /armour command. >");
SendClientMessage(playerid,YELLOW,"< Added admin and login/register system. >");
SendClientMessage(playerid,YELLOW,"< Added new spawn position. >");
SendClientMessage(playerid,YELLOW,"____________________________________________");
return 1;
}
return 0;
}