Please help, command is bugged - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Please help, command is bugged (
/showthread.php?tid=249768)
Please help, command is bugged -
buzifej - 20.04.2011
The command is not good.
Код:
CMD:callmedic(playerid, params[]) {
if(medic[playerid] == 1) return SendClientMessage(playerid,COLOR_RED,"Error: You have called medic!");
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
hivo = playerid;
fogadva[playerid] = 0;
y1 = y;
x1 = x;
z1 = z;
for(new i=0;i<MAX_PLAYERS;i++) {
if(gTeam[i] == TEAM_MENTO) {
if(IsPlayerConnected(i)) {
new str[128];
GetPlayerName(playerid,str,sizeof(str));
mento1[playerid] = 1;
format(str,sizeof(str),"%s has called the medic Call accept: /mentoaccept",str);
SendClientMessage(i,COLOR_WHITE,str);
}else{
if(NoMedic < 1)
{
SendClientMessage(playerid, COLOR_GREY, " no paramedic service");
SendClientMessage(playerid, COLOR_GREEN, "You have been automatice healed");
ClearAnimations(playerid);
SetPlayerHealth(playerid,90);
animba[playerid] = 0;
TogglePlayerControllable(playerid, 1);
if(animba[playerid] == 0)
{
SendClientMessage(playerid,COLOR_RED,"You are not in anim");
}
}
}
}
}
return 1;
}
Re: Please help, command is bugged -
buzifej - 20.04.2011
istenem abba a gyors formбtokba faszopok.
Re: Please help, command is bugged -
xir - 20.04.2011
This give any errors/warnings? If yes post them
Re: Please help, command is bugged -
s0nic - 20.04.2011
Try this..:
pawn Код:
CMD:callmedic(playerid, params[])
{
if(medic[playerid] == 1) return SendClientMessage(playerid,COLOR_RED,"Error: You have called medic!");
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
hivo = playerid;
fogadva[playerid] = 0;
y1 = y;
x1 = x;
z1 = z;
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
if(gTeam[i] == TEAM_MENTO)
{
new str[128];
GetPlayerName(playerid,str,sizeof(str));
mento1[playerid] = 1;
format(str,sizeof(str),"%s has called the medic Call accept: /mentoaccept",str);
SendClientMessage(i,COLOR_WHITE,str);
}
else if(NoMedic < 1)
{
SendClientMessage(playerid, COLOR_GREY, " no paramedic service");
SendClientMessage(playerid, COLOR_GREEN, "You have been automatice healed");
ClearAnimations(playerid);
SetPlayerHealth(playerid,90);
animba[playerid] = 0;
TogglePlayerControllable(playerid, 1);
}
else if(animba[playerid] == 0)
{
SendClientMessage(playerid,COLOR_RED,"You are not in anim");
}
}
}
return 1;
}