25.05.2011, 08:26
ae galera ta foda isso aki , tipo o medico usa /curar mais nao tem nada de /aceitar medico nein nada , so manda o comando ja cura e ja passa o dinheiro sem o paciente aceita alguem poderia me ajudar ?
ta ae se precisarem mais algum pawn pra verem qual poblema me fala ou me passa um /curar feito xD
pawn Код:
if(strcmp(cmd, "/curar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
GetPlayerName(playerid, sendername, sizeof(sendername));
new location = PlayerInfo[playerid][pLocal];
if(!strlen(tmp))
{
if(location != 255)
{
if(location < 99)
{
if(HouseInfo[location][hArrombada] == 1 && PlayerToPoint(50.0,playerid,HouseInfo[location][hEntrancex],HouseInfo[location][hEntrancey],HouseInfo[location][hEntrancez]))
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo pode se curar aqui.");
return 1;
}
if(HouseInfo[location][hArm] == 1 && IsACop(playerid))
{
format(string, sizeof(string), "%s colocou um colete a prova de balas.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
TogglePlayerControllable(playerid, 0);
GetPlayerPos(playerid, Unspec[playerid][sPx], Unspec[playerid][sPy], Unspec[playerid][sPz]);
Unspec[playerid][sPint] = PlayerInfo[playerid][pInt];
Unspec[playerid][sLocal] = PlayerInfo[playerid][pLocal];
SetPlayerPos(playerid,1527.5,-12.1,1002.0);
PlayerInfo[playerid][pLocal] = 255;
SetPlayerArmour(playerid, 65.0);
SetPlayerInterior(playerid,99);
Spectate[playerid] = 257;
}
else
{
format(string, sizeof(string), "Este local nгo possui atualizaзгo de colete, ou vocк nгo й PM/PF/FA.");
SendClientMessage(playerid, TEAM_GREEN_COLOR,string);
}
if(HouseInfo[location][hHel] == 1)
{
new Float:tempheal;
GetPlayerHealth(playerid,tempheal);
if ( tempheal < 100.0)
{
SetPlayerHealth(playerid,100.0);
PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0);
format(string, sizeof(string), "Vocк restaurou sua barra de saъde.");
SendClientMessage(playerid, COLOR_WHITE,string);
}
else
{
SendClientMessage(playerid, COLOR_WHITE,"Sua saъde jб estб restaurada.");
}
}
else
{
format(string, sizeof(string), "Este local nгo possui atualizaзгo de saъde.");
SendClientMessage(playerid, COLOR_WHITE,string);
}
return 1;
}
else if(location == 101)//Restaurant
{
new Float:tempheal;
GetPlayerHealth(playerid,tempheal);
if ( tempheal < 100.0)
{
SetPlayerHealth(playerid,100.0);
PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0);
format(string, sizeof(string), "Vocк restaurou sua barra de saъde.");
SendClientMessage(playerid, COLOR_WHITE,string);
}
else
{
SendClientMessage(playerid, COLOR_WHITE,"Vocк jб estб curado com 100.0 de saъde.");
}
return 1;
}
else if(location == 102 && IsACop(playerid))//Police Armoury
{
SetPlayerHealth(playerid,100.0);
format(string, sizeof(string), "%s colocou um colete a prova de balas.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
TogglePlayerControllable(playerid, 0);
GetPlayerPos(playerid, Unspec[playerid][sPx], Unspec[playerid][sPy], Unspec[playerid][sPz]);
Unspec[playerid][sPint] = PlayerInfo[playerid][pInt];
Unspec[playerid][sLocal] = PlayerInfo[playerid][pLocal];
SetPlayerPos(playerid,1527.5,-12.1,1002.0);
PlayerInfo[playerid][pLocal] = 255;
SetPlayerArmour(playerid, 90.0);
SetPlayerInterior(playerid,99);
Spectate[playerid] = 257;
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "USO: /curar [playerid/Parte-do-Nick] [preзo]");
return 1;
}
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USO: /curar [playerid/Parte-do-Nick] [preзo]");
return 1;
}
moneys = strval(tmp);
if(moneys < 1 || moneys > 1000) { SendClientMessage(playerid, COLOR_GREY, " Preзo de cura й de R$1 a R$1000 !"); return 1; }
if (giveplayerid == playerid)
{
SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo pode curar б vocк mesmo !");
return 1;
}
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new giveambu = GetVehicleModel(GetPlayerVehicleID(giveplayerid));
new playambu = GetVehicleModel(GetPlayerVehicleID(playerid));
if(PlayerInfo[playerid][pMember]==4)//medicos
{
if(IsAnAmbulance(playambu) && playambu == giveambu)
{
if(GetPlayerGP(playerid) < moneys)
{
SendClientMessage(playerid, COLOR_GREY, " Esse jogador nгo pode pagar.");
return 1;
}
new Float:tempheal;
GetPlayerHealth(giveplayerid,tempheal);
if(tempheal >= 100.0)
{
SendClientMessage(playerid, TEAM_GREEN_COLOR," Essa pessoa jб foi totalmente curada.");
return 1;
}
if(moneys < 1 || moneys > 1000)
{
SendClientMessage(playerid, COLOR_GRAD1, "Escolha entre 1 e R$1000");
return 1;
}
//CuraAcc[giveplayerid] = 1;
//format(string, sizeof(string), "O Mйdico Lhe Ofereceu Cura Por R$ %d Use /aceitar cura Para Aceitar",moneys);
// SendClientMessage(giveplayerid, TEAM_GREEN_COLOR,string);
format(string, sizeof(string), "~y~voce curou ~n~~w~%s~n~~g~R$ %d", giveplayer,moneys);
GameTextForPlayer(playerid, string, 5000, 1);
GivePlayerGP(playerid,moneys);
GivePlayerGP(giveplayerid,-moneys);
new hp = 0;
if(PlayerInfo[playerid][pPainPerk] > 0)
{
hp = 20 * PlayerInfo[playerid][pPainPerk]; hp += 100;
SetPlayerHealth(giveplayerid, hp);
}
else
{
hp = 100;
SetPlayerHealth(giveplayerid, 100);
}
PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0);
PlayerPlaySound(giveplayerid, 1150, 0.0, 0.0, 0.0);
format(string, sizeof(string), "Vocк estб saudбvel denovo (100.0 hp) por R$ %d ",moneys);
SendClientMessage(giveplayerid, TEAM_GREEN_COLOR,string);
if(STDPlayer[giveplayerid] > 0)
{
STDPlayer[giveplayerid] = 0;
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, "Vocк jб nгo estб infectado com uma doenзa sexualmente transmissнvel mais porque os mйdicos lhe ajudaram !");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo estб na Ambulвncia / Helicoptero !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo estб autorizado a usar este comando !");
return 1;
}
}
}
else
{
format(string, sizeof(string), " %d nгo й um player Ativo.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
ta ae se precisarem mais algum pawn pra verem qual poblema me fala ou me passa um /curar feito xD