PDA

View Full Version : help with /heal


boyan96
11/11/2011, 11:48 AM
how i can make /help to setplayer HP and armour to 100 but the command to can use every 2 minutes

Mr_Scripter
11/11/2011, 11:49 AM
use SetTimerEx

boyan96
11/11/2011, 11:51 AM
but how i make this but i have pawno is crashing
if(strcmp(cmd,"/heal",true)==0)
{
if(PlayerInfo[playerid][pDonateRank] >= 4)
{
if(GetTickCount() - GetPVarInt(playerid, "heal") < 120000) return SendClientMessage(playerid, 0xFF0000FF, "you must wait 2 minutes");
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
SendClientMessage(playerid,COLOR_GREEN,"You've set your health and armour to 100");
SetPVarInt(playerid, "heal", GetTickCount());

}
}
return 1;
}

SmiT
11/11/2011, 11:54 AM
Maybe because you have an extra bracket?
if(strcmp(cmd,"/heal",true)==0)
{
if(PlayerInfo[playerid][pDonateRank] >= 4)
{
if(GetTickCount() - GetPVarInt(playerid, "heal") < 120000) return SendClientMessage(playerid, 0xFF0000FF, "you must wait 2 minutes");
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
SendClientMessage(playerid,COLOR_GREEN,"You've set your health and armour to 100");
SetPVarInt(playerid, "heal", GetTickCount());

} /* <-------------------- */
}
return 1;
}

boyan96
11/11/2011, 11:56 AM
again crash wheen i delete the command the gamemode is compile

Cypress
11/11/2011, 12:34 PM
Here you go.


if(strcmp(cmd,"/heal",true)==0)
{
if(PlayerInfo[playerid][pDonateRank] >= 4)
{
if(GetTickCount() - GetPVarInt(playerid, "heal") < 120000) return SendClientMessage(playerid, 0xFF0000FF, "you must wait 2 minutes");
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
SendClientMessage(playerid,COLOR_GREEN,"You've set your health and armour to 100");
SetPVarInt(playerid, "heal", GetTickCount());
}
return 1;
}