Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(strcmp(cmd, "/vida", 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][hArm] == 1 && IsACop(playerid))
- {
- format(string, sizeof(string), "* %s Foi Curado.", 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;
- SetPlayerInterior(playerid,99);
- Spectate[playerid] = 257;
- }
- else
- {
- format(string, sizeof(string), "Este lugar nao tem lugar de se curar.");
- 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), "Voce foi curando com *100* para sua vida.");
- HouseInfo[location][hHel] = 0;
- SendClientMessage(playerid, TEAM_GREEN_COLOR,string);
- }
- else
- {
- SendClientMessage(playerid, TEAM_GREEN_COLOR,"Voce ja esta curado.");
- }
- }
- else
- {
- format(string, sizeof(string), "Este lugar nao tem lugar de se curar.");
- SendClientMessage(playerid, TEAM_GREEN_COLOR,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), "Voce foi curando com *100* para sua vida.");
- SendClientMessage(playerid, TEAM_GREEN_COLOR,string);
- }
- else
- {
- SendClientMessage(playerid, TEAM_GREEN_COLOR,"Voce ja esta curado.");
- }
- }
- else if(location == 102 && IsACop(playerid))//Police Armorry
- {
- SetPlayerHealth(playerid,100.0);
- format(string, sizeof(string), "* %s Foi Curado.", 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;
- SetPlayerInterior(playerid,99);
- Spectate[playerid] = 257;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GRAD2, "USE: /vida [ id ] [price]");
- return 1;
- }
- }
- giveplayerid = ReturnUser(tmp);
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_GRAD2, "USE: /vida [ id ] [price]");
- return 1;
- }
- moneys = strval(tmp);
- if(moneys < 1 || moneys > 1000) { SendClientMessage(playerid, COLOR_GREY, " O Preco nao pode passar de 1000 !"); return 1; }
- if (giveplayerid == playerid)
- {
- SendClientMessage(playerid, COLOR_GRAD1, " Voce nao pode se curar!");
- return 1;
- }
- if (IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- if(gTeam[playerid] == TEAM_CYAN||PlayerInfo[playerid][pMembro]==4||PlayerInfo[playerid][pLider]==4)//model
- {
- new Veh = GetPlayerVehicleID(playerid);
- if(IsAnAmbulanceCar(Veh))
- {
- new Float:tempheal;
- GetPlayerHealth(giveplayerid,tempheal);
- if(tempheal >= 100.0)
- {
- SendClientMessage(playerid, TEAM_GREEN_COLOR," Este player ja esta curado.");
- return 1;
- }
- format(string, sizeof(string), "~y~Voce foi curado ~n~~w~%s~n~~g~R$%d", giveplayer,moneys);
- GameTextForPlayer(playerid, string, 5000, 1);
- GivePlayerMoneyEx(playerid,moneys);
- GivePlayerMoneyEx(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), "Voce foi curado, %d de saude por -R$%d",hp,moneys);
- SendClientMessage(giveplayerid, TEAM_GREEN_COLOR,string);
- if(DSTPlayer[giveplayerid] > 0)
- {
- DSTPlayer[giveplayerid] = 0;
- SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, "* Voce nao esta infectado com nem uma DST, por causa de ajuda medicas!");
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GRAD1, " Um de vocês não está no veiculo !");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GRAD1, "Você não está autorizado a usar o comando!");
- return 1;
- }
- }
- }
- else
- {
- format(string, sizeof(string), " %d e um player desativado.", giveplayerid);
- SendClientMessage(playerid, COLOR_GRAD1, string);
- }
- }
- return 1;
- }
Add Comment
Please, Sign In to add comment