10 seconds before the command -
Join7 - 12.09.2011
When the write command /healall, write to all that after 10 seconds will be used command /healall
Re: 10 seconds before the command -
Kingunit - 12.09.2011
You can use timers for it. Something like this:
pawn Код:
CMD:healall(playerid, params[])
{
SendClientMessage(playerid, COLOR_WHITE, "[SERVER] Everyone is getting healed in 10seconds!");
SetTimer("heal", 10000, false);
return 1;
}
forward heal();
public heal()
{
// Here your heal code.
// Untested
}
Re: 10 seconds before the command -
Jafet_Macario - 12.09.2011
PHP код:
YCMD:healall(playerid, o[], help)
{
#pragma unused help
#pragma unused o
SetTimer("healall", 10000, false);
SendClientMessageToAll(-1,"You will be healed in 10 seconds");
return 1;
}
forward healall();
public healall()
{
foreach(Player, i)
{
SetPlayerHealth(i, 100);
}
}
Too late sorz
Re: 10 seconds before the command -
Join7 - 12.09.2011
D:\Server\gamemodes\drift.pwn(6253) : warning 202: number of arguments does not match definition
D:\Server\gamemodes\drift.pwn(6253) : error 017: undefined symbol "o"
D:\Server\gamemodes\drift.pwn(6255) : error 017: undefined symbol "help"
D:\Server\gamemodes\drift.pwn(6256) : error 017: undefined symbol "o"
D:\Server\gamemodes\drift.pwn(626
![Cool](images/smilies/cool.gif)
: warning 225: unreachable code
D:\Server\gamemodes\drift.pwn(6253) : warning 203: symbol is never used: "YCMD"
D:\Server\gamemodes\drift.pwn(7657) : error 017: undefined symbol "foreach"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
Re: 10 seconds before the command -
Kingunit - 12.09.2011
That's because you didn't included YCMD. Download it or use mine ZCMD version.
Include it like:
pawn Код:
#include <ZCMD>
// In the ZCMD case
And place the ZCMD include (use the search function to download it) inside the pawno / includes folder.
Re: 10 seconds before the command -
Join7 - 12.09.2011
I include YCMD
Код:
#define ycmd(%1) if(!strcmp(cmdtext,%1,true,strlen(%1))&&((!strlen(cmdtext[strlen(%1)])&&format(params,sizeof(params),""))||(cmdtext[strlen(%1)]==' '&&format(params,sizeof(params),"%s",cmdtext[strlen(%1)+1]))))
#define ycmd_red(%1) format(params,sizeof(params),""%1" %s",params),CallLocalFunction("OnPlayerCommandText","ds",playerid,params)
and zcmd
and still the same
Re: 10 seconds before the command -
Kingunit - 12.09.2011
Remove the YCMD thing and replace it with my ZCMD code. And include the ZCMD. Then it's probably working.
Use foreach to heal everyone.
Re: 10 seconds before the command -
Join7 - 12.09.2011
only #include <zcmd>?
Re: 10 seconds before the command -
Kingunit - 12.09.2011
Yes, then you need to use my ZCMD code.
pawn Код:
CMD:healall(playerid, params[])
{
SendClientMessage(playerid, COLOR_WHITE, "[SERVER] Everyone is getting healed in 10seconds!");
SetTimer("heal", 10000, false);
return 1;
}
forward heal();
public heal()
{
foreach(Player, i)
{
SetPlayerHealth(i, 100);
}
// Thank you Jafet_Macario
}