18.10.2013, 20:36
how to make a variable to used three times commands
mean /healme
mean /healme
new HealMax[MAX_PLAYERS];
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/heal", cmdtext, true, 5) == 0)
{
if(HealMax[playerid] != 3) // he don't use this command 3 time
{
// set player health to 100
HealMax[playerid]++; // + 1
}
else // he use this command 3 times
{
SendClientMessageToAll(color, "you can use this command only 3 time per life");
}
return 1;
}
return 0;
}// matnix
new HealMax[MAX_PLAYERS];//set it to HealMax[playerid]=0; when they disconnect
CMD:healme(playerid,params[])
{
if(HealMax[playerid] != 3)
{
SetPlayerHealth(playerid,100);
HealMax[playerid]++;
}
else return SendClientMessage(playerid,-1,"You have met the max limit of 3 heals");
return 1;
}
D:\SERVER\filterscripts\script.pwn(132) : error 017: undefined symbol "HealMax"
D:\SERVER\filterscripts\script.pwn(132) : warning 215: expression has no effect
D:\SERVER\filterscripts\script.pwn(132) : error 001: expected token: ";", but found "]"
D:\SERVER\filterscripts\script.pwn(132) : error 029: invalid expression, assumed zero
D:\SERVER\filterscripts\script.pwn(132) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.