23.05.2013, 04:58
Guys, i am having a tag mismatch error on this code i have made and i cant find out why. The code verifies the position of the target and then use that position so set a radius on with the player can use the command.
Code:
if(strcmp(cmd,"/socorrer",true) == 0)
{
new Float: alvoposx[MAX_PLAYERS];
new Float: alvoposy[MAX_PLAYERS];
new Float: alvoposz[MAX_PLAYERS];
tmp = strtok(cmdtext,idx);
giveplayerid = ReturnUser(tmp);
GetPlayerPos(giveplayerid, alvoposx[giveplayerid], alvoposy[giveplayerid], alvoposz[giveplayerid]);
if(!strlen(tmp))
{
SendClientMessage(playerid,COLOR_GRAD1,"USO: /socorrer [ID]");
return 1;
}
if(PlayerInfo[playerid] [pMember] == 4)
{
if(IsPlayerInRangeOfPoint(playerid, 4.0, alvoposx[idx], alvoposy[idx], alvoposz[idx]))
{
if(Salvar[giveplayerid] == 1)
{
if(RepetirSocorro[giveplayerid] == 0)
{
RepetirSocorro[giveplayerid] = 1;
SetPlayerHealth(giveplayerid, 100.0);
SendClientMessage(giveplayerid, COLOR_LIGHTCYAN, "Vocк foi socorrido rapidamente por um paramйdico!");
SendClientMessage(playerid, COLOR_LIGHTCYAN, "Vocк socorreu uma vнtima com sucesso!");
Salvar[giveplayerid] = 0;
KillTimer(MortaoTimer[giveplayerid]);
KillTimer(Mortao2Timer[giveplayerid]);
Morrendo[giveplayerid] = 0;
SetTimer("RepetirSocorro1", 240000, 0);
}
if(!RepetirSocorro[giveplayerid] == 0)
{
SendClientMessage(playerid, ORANGE, "Essa pessoa ja foi socorrida recentemente.");
}
}
if(!Salvar[giveplayerid] == 1)
{
SendClientMessage(playerid, ORANGE, "Essa pessoa nгo pode ser socorrida.");
SendClientMessage(playerid, ORANGE, "Se a pessoa estiver agonizando, o tempo de socorro se esgotou.");
SendClientMessage(playerid, ORANGE, "Entгo seria necessбria a chamada de uma ambulвncia.");
}
}
if(!IsPlayerInRangeOfPoint(playerid, 4.0, alvoposx[idx], alvoposy[idx], alvoposz[idx]))
{
SendClientMessage(playerid, COLOR_YELLOW, "Vocк estб muito longe do seu alvo.");
}
}
if(!PlayerInfo[playerid] [pMember] == 4)
{
SendClientMessage(playerid, ORANGE, "Vocк nгo й da SAMU.");
}
}
Thanks in advance.
Code:
if(strcmp(cmd,"/socorrer",true) == 0)
{
new Float: alvoposx[MAX_PLAYERS];
new Float: alvoposy[MAX_PLAYERS];
new Float: alvoposz[MAX_PLAYERS];
tmp = strtok(cmdtext,idx);
giveplayerid = ReturnUser(tmp);
GetPlayerPos(giveplayerid, alvoposx[giveplayerid], alvoposy[giveplayerid], alvoposz[giveplayerid]);
if(!strlen(tmp))
{
SendClientMessage(playerid,COLOR_GRAD1,"USO: /socorrer [ID]");
return 1;
}
if(PlayerInfo[playerid] [pMember] == 4)
{
if(IsPlayerInRangeOfPoint(playerid, 4.0, alvoposx[idx], alvoposy[idx], alvoposz[idx]))
{
if(Salvar[giveplayerid] == 1)
{
if(RepetirSocorro[giveplayerid] == 0)
{
RepetirSocorro[giveplayerid] = 1;
SetPlayerHealth(giveplayerid, 100.0);
SendClientMessage(giveplayerid, COLOR_LIGHTCYAN, "Vocк foi socorrido rapidamente por um paramйdico!");
SendClientMessage(playerid, COLOR_LIGHTCYAN, "Vocк socorreu uma vнtima com sucesso!");
Salvar[giveplayerid] = 0;
KillTimer(MortaoTimer[giveplayerid]);
KillTimer(Mortao2Timer[giveplayerid]);
Morrendo[giveplayerid] = 0;
SetTimer("RepetirSocorro1", 240000, 0);
}
if(!RepetirSocorro[giveplayerid] == 0)
{
SendClientMessage(playerid, ORANGE, "Essa pessoa ja foi socorrida recentemente.");
}
}
if(!Salvar[giveplayerid] == 1)
{
SendClientMessage(playerid, ORANGE, "Essa pessoa nгo pode ser socorrida.");
SendClientMessage(playerid, ORANGE, "Se a pessoa estiver agonizando, o tempo de socorro se esgotou.");
SendClientMessage(playerid, ORANGE, "Entгo seria necessбria a chamada de uma ambulвncia.");
}
}
if(!IsPlayerInRangeOfPoint(playerid, 4.0, alvoposx[idx], alvoposy[idx], alvoposz[idx]))
{
SendClientMessage(playerid, COLOR_YELLOW, "Vocк estб muito longe do seu alvo.");
}
}
if(!PlayerInfo[playerid] [pMember] == 4)
{
SendClientMessage(playerid, ORANGE, "Vocк nгo й da SAMU.");
}
}
Thanks in advance.