enum MedKitEnum { bool: MedKitPlayer, bool: MedPlayer, MedKits, VidaMedKit, MedKitObject, TimerReceber, Float:PosPlayerX, Float:PosPlayerY, Float:PosPlayerZ } new MedKitDados[MAX_PLAYERS][MedKitEnum]; CMD:medkit(playerid){ if(MedKitDados[playerid][MedPlayer] == true) return SendClientMessage(playerid, -1, "Vocк ja criou um medkit"); GetPlayerPos(playerid, MedKitDados[playerid][PosPlayerX],MedKitDados[playerid][PosPlayerY], MedKitDados[playerid][PosPlayerZ]); MedKitDados[playerid][MedKits] = CreatePickup(19606,1, MedKitDados[playerid][PosPlayerX], MedKitDados[playerid][PosPlayerY], MedKitDados[playerid][PosPlayerZ]-1.5), MedKitDados[playerid][MedKitObject] = CreateDynamicObject(11736, MedKitDados[playerid][PosPlayerX], MedKitDados[playerid][PosPlayerY], MedKitDados[playerid][PosPlayerZ]-1, 0.0, 0.0, 0.0); MedKitDados[playerid][VidaMedKit] = 10; format(str,89, "Voce criou um Medkit em X:%.2f Y:%.2f Z:%.2f", MedKitDados[playerid][PosPlayerX], MedKitDados[playerid][PosPlayerY], MedKitDados[playerid][PosPlayerZ]); PlayerPlaySound(playerid, 32000, 0.0, 0.0, 0.0), MedKitDados[playerid][MedPlayer] = true; return true; } public OnPlayerDisconnect(playerid, reason) { DestruirMedKit(playerid); return true; } public OnPlayerPickUpPickup(playerid, pickupid) { if(pickupid == MedKitDados[playerid][MedKits]) { MedKitDados[playerid][TimerReceber] = SetTimerEx("AumentarVidaMed",2000,false,"i",player id); } return true; } forward AumentarVidaMed(playerid); public AumentarVidaMed(playerid) { new Floatoma,Float:Vida5252,Float:Colete5252; GetPlayerArmour(playerid, Colete5252); GetPlayerHealth(playerid, Vida5252); soma = Vida5252+Colete5252; floatround(soma); if(!IsPlayerInRangeOfPoint(playerid, 2.0, MedKitDados[playerid][PosPlayerX], MedKitDados[playerid][PosPlayerY], MedKitDados[playerid][PosPlayerZ])) { KillTimer(MedKitDados[playerid][TimerReceber]); } else { if(soma != 200) { MedKitDados[playerid][VidaMedKit]--; if(Vida5252 > 99) { GetPlayerArmour(playerid, Colete5252); SetPlayerArmour(playerid, (Colete5252+6)); PlayerPlaySound(playerid, 5202, 0.0, 0.0, 0.0); } if(Vida5252 < 99) { GetPlayerHealth(playerid, Vida5252); SetPlayerHealth(playerid, (Vida5252+6)); PlayerPlaySound(playerid, 5202, 0.0, 0.0, 0.0); } if(MedKitDados[playerid][VidaMedKit] == 0) { DestruirMedKit(playerid); SendClientMessage(playerid, -1, "MedKit Quebrado!"); KillTimer(MedKitDados[playerid][TimerReceber]); PlayerPlaySound(playerid, 6402, 0.0, 0.0, 0.0); } if(Vida5252 >= 100) SetPlayerHealth(playerid, 100); if(Colete5252 >= 100) SetPlayerArmour(playerid, 100); } else { SendClientMessage(playerid, -1, "Vida e Colete cheio!"); } } return 1; } DestruirMedKit(playerid) { DestroyPickup(MedKitDados[playerid][MedKits]); DestroyObject(MedKitDados[playerid][MedKitObject]); MedKitDados[playerid][MedPlayer] = false; return 1; } |
C:\Users\Usuario\Desktop\Novas GMS\gamemodes\BPS.pwn(92242) : warning 219: local variable "Colete" shadows a variable at a preceding level C:\Users\Usuario\Desktop\Novas GMS\gamemodes\BPS.pwn(92244) : error 035: argument type mismatch (argument 2) C:\Users\Usuario\Desktop\Novas GMS\gamemodes\BPS.pwn(92249) : warning 213: tag mismatch C:\Users\Usuario\Desktop\Novas GMS\\gamemodes\BPS.pwn(9225 : warning 213: tag mismatch C:\Users\Usuario\Desktop\Novas GMS\gamemodes\BPS.pwn(9225 : warning 213: tag mismatch C:\Users\Usuario\Desktop\Novas GMS\gamemodes\BPS.pwn(92242) : warning 203: symbol is never used: "Colete" |
DetectarMedKit(playerid) { new Float:Vida, Float:Colete; GetPlayerHealth(playerid, Vida); GetPlayerArmour(playerid, Colete); for(new i; i < MAX_MEDKITS; i++) { if(IsPlayerInRangeOfPoint(playerid, 1.0, MedKitDados[i][mX], MedKitDados[i][mY], MedKitDados[i][mZ]) && MedKitDados[i][mAtivo]) { if(Vida >= 100 && Colete >= 100) continue; else if(Vida < 100) { SetPlayerHealth(playerid, (Vida+7)); PlayerPlaySound(playerid, 5202, 0.0, 0.0, 0.0); MedKitDados[i][mDurabilidade]--; } else if(Vida >= 100) { SetPlayerArmour(playerid, (Colete+7)); PlayerPlaySound(playerid, 5202, 0.0, 0.0, 0.0); MedKitDados[i][mDurabilidade]--; } if(MedKitDados[i][mDurabilidade] == 0) { DestruirMedKit(MedKitDados[i][mID]); MedKitZ[playerid] = false; PlayerPlaySound(playerid, 6402, 0.0, 0.0, 0.0); SendClientMessage(playerid, -1, "Medkit quebrou!"); } } } return 1; } |