14.12.2012, 20:55
You need to have this if you are using dcmd
Definition
Then Your Command Bellow
And For Gametext i have no idea for Dark Green And Aqua but! here is blue,green,purple
Hope you understand it
PS: I tried to explain it very for all people who doesn't know about it
pawn Код:
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
dcmd(heal,4,cmdtext);
return 0;
}
pawn Код:
dcmd_heal(playerid,params[]) // need to put it so it will not show as undefined and will also read the command
{
if(AccInfo[playerid][Level] >= 1)
{
SetPlayerHealth(playerid, 100);
SetGameTextForPlayer(playerid, "You have been healed", 4, 3000);
}
return 1;
}
pawn Код:
case 11:
{
GameTextForPlayer(playerid, "~b~S.W.A.T", 3000, 3); //Blue
}
pawn Код:
case 13, 14:
{
GameTextForPlayer(playerid, "~p~Medics", 3000, 3); //Purple
}
pawn Код:
case 15, 16:
{
GameTextForPlayer(playerid, "~g~Taxi Drivers", 3000, 3); //Green
}
PS: I tried to explain it very for all people who doesn't know about it