28.05.2013, 06:09
Hello guys, I need small help
I'm using Zombie Apocalypse script by Kitten, However in the script, I need to make only medic can /cure the infected player if the medic near the infected player. Otherwise it will show up message by saying "You're not near the target"
Here's the current code for cure
and also medics can /cure himself using this command, I need to disable it
Thanks in advance
I'm using Zombie Apocalypse script by Kitten, However in the script, I need to make only medic can /cure the infected player if the medic near the infected player. Otherwise it will show up message by saying "You're not near the target"
Here's the current code for cure
pawn Код:
CMD:cure(playerid,params[])
{
if(team[playerid] == TEAM_HUMAN)
{
if(pInfo[playerid][pHumanClass] == MEDIC || pInfo[playerid][pHumanClass] == ADVANCEDMEDIC || pInfo[playerid][pHumanClass] == HEAVYMEDIC || pInfo[playerid][pHumanClass] == VIPMEDIC || pInfo[playerid][pHumanClass] == DOCTOR)
{
new targetid,string[128],str[256];
if(sscanf(params,"u", targetid)) return SendClientMessage(playerid,-1,""chat" /cure [playerid]");
if(pInfo[targetid][IsPlayerInfected] == 1)
{
CurePlayer(targetid);
format(string,sizeof(string),"~n~~n~~n~~n~~g~%s~w~ %s has cured you",GetClassName(playerid),PlayerName(playerid));
GameTextForPlayer(targetid,string,3500,5);
format(str,sizeof(str),""chat""COL_LGREEN" %s %s has cured %s",GetClassName(playerid),PlayerName(playerid),PlayerName(targetid));
SendClientMessageToAll(-1,str);
GivePlayerXP(playerid,20);
}
else return SendClientMessage(playerid,-1,""chat" The player you are trying to cure isn't infected");
}
else return SendClientMessage(playerid,-1,""chat""COL_LGREEN" You'll need to be an Medic & Advanced Medic or V.I.P Medic to use this command!");
}
else return SendClientMessage(playerid,-1,""chat""COL_LGREEN" You'll need to be an human to use this command!");
return 1;
}
Thanks in advance