Class System Help! +REP - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Class System Help! +REP (
/showthread.php?tid=382849)
Class System Help! +REP -
Nirzor - 05.10.2012
i want to make a command named /heal for medics so only medics can heal his or her team member if the player is
in other team then the medic can't heal and also player needs to be close to be healed and needs to be team member
and player can use this /heal command every 2 minutes and also another command /fix so if player is in any vehicle
he can fix it every 2 minutes he can use the command and if player is not in vehicle error message
and /heal for Medic and /fix for Mechanic and my teams are
Soviet Union
Russian Force
Spanish Invaders
US Army
Re: Class System Help! +REP -
xMCx - 05.10.2012
pawn Код:
CMD:heal(playerid,params[])
{
new tid;
new Float:health
if(sscanf(params,"ud",tid,Float:health)) return SendClientMessage(playerid,-1,"USAGE: /heal [id] [value]");
if(!IsPlayerConnected(tid)) return SendClientMessage(playerid,-1,"Error: Invalid ID ");
if(GetPlayerTeam(playerid) == Medic)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if(!IsPlayerInRangeOfPoint(tid, 5.0, x, y, z)) return SendClientMessage(playerid,-1,"Your not near anyone");
SetPlayerHealth(tid,Float:health);
}
return 1;
}
Re: Class System Help! +REP -
JaKe Elite - 05.10.2012
to check if you gonna heal a team member or not
put this
pawn Код:
if(GetPlayerTeam(playerid) != MEDIC) return //do whatever you want
//!= means if not.
Re: Class System Help! +REP -
xMCx - 05.10.2012
Quote:
Originally Posted by Romel
to check if you gonna heal a team member or not
put this
pawn Код:
if(GetPlayerTeam(playerid) != MEDIC) return //do whatever you want
//!= means if not.
|
i was looking for that tho but i missed it Dx , thanks
Re: Class System Help! +REP -
JaKe Elite - 05.10.2012
i also forgot this part
pawn Код:
if(GetPlayerTeam(id) != MEDIC) return //do whatever you want