09.01.2012, 11:48
show me your code (the last one with errors not the first one that you post at the top)
did you did like this? don't tell me you remove the command return 1; too
WRONG you doing it so wrong
this is the right version
for the public function error heres the simple and easy way to fix it
add forward KickAll(); in the top of public KickAll() like this
hope its clear to you know
did you did like this? don't tell me you remove the command return 1; too
pawn Код:
CMD:redalert(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
new string[256];
new aname[256];
GetPlayerName(playerid,aname,sizeof(aname));
GameTextForAll("~r~Red Alert",7000,4);
format(string,sizeof(string), "Admin: %s has called Red Alert",aname);
SendClientMessageToAll(0xAA3333AA,string);
SendClientMessageToAll(0xAA3333AA,"You will all be kicked in ten seconds.");
RedAlertTimer = SetTimer("KickAll",10000,0);
SendClientMessage(playerid, 0xFFFF00AA, "Red Alert Successful. To Abort Type /abort");
printf("%s has initialized the red alert countdown.",aname);
}
else
{
return 0;
}
}
pawn Код:
CMD:abort(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
new string[256];
new aname[256];
GetPlayerName(playerid,aname,sizeof(aname));
GameTextForAll("~y~Red Alert Aborted",7000,4);
format(string,sizeof(string), "Admin: %s has canceled the Red Alert",aname);
SendClientMessageToAll(0x33AA33AA,string);
KillTimer(RedAlertTimer);
SendClientMessage(playerid, 0xFFFF00AA, "Red Alert Abort Successful.");
printf("%s has cancelled the red alert countdown.",aname);
}
else
{
return 0;
}
}
this is the right version
pawn Код:
CMD:redalert(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
new string[256];
new aname[256];
GetPlayerName(playerid,aname,sizeof(aname));
GameTextForAll("~r~Red Alert",7000,4);
format(string,sizeof(string), "Admin: %s has called Red Alert",aname);
SendClientMessageToAll(0xAA3333AA,string);
SendClientMessageToAll(0xAA3333AA,"You will all be kicked in ten seconds.");
RedAlertTimer = SetTimer("KickAll",10000,0);
SendClientMessage(playerid, 0xFFFF00AA, "Red Alert Successful. To Abort Type /abort");
printf("%s has initialized the red alert countdown.",aname);
}
else
{
return 0;
}
return 1;
}
CMD:abort(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
new string[256];
new aname[256];
GetPlayerName(playerid,aname,sizeof(aname));
GameTextForAll("~y~Red Alert Aborted",7000,4);
format(string,sizeof(string), "Admin: %s has canceled the Red Alert",aname);
SendClientMessageToAll(0x33AA33AA,string);
KillTimer(RedAlertTimer);
SendClientMessage(playerid, 0xFFFF00AA, "Red Alert Abort Successful.");
printf("%s has cancelled the red alert countdown.",aname);
}
else
{
return 0;
}
return 1;
}
add forward KickAll(); in the top of public KickAll() like this
pawn Код:
forward KickAll();
public KickAll()