15.12.2017, 16:04
new bool: sHospital[MAX_PLAYERS][8];
public OnPlayerSpawn(playerid):
public OnPlayerDeath(playerid, killerid, reason)
Nгo sei se estб correto o modo que estou fazendo, Mas o que eu gostaria de fazer й o seguinte : Quando player morrer nascer no hospital mais prуximo, estou fazendo no modo correto? Alguem poderia ajudar?
public OnPlayerSpawn(playerid):
Код:
if(sHospital[playerid][0]) { SetPlayerPos(playerid,-2652.4170,633.1534,14.4531); sHospital[playerid][0] = 0; } else if(sHospital[playerid][1]) { SetPlayerPos(playerid,-2207.6372,-2285.8066,30.6250); sHospital[playerid][1] = 0; } else if(sHospital[playerid][2]) { SetPlayerPos(playerid,1173.3130,-1323.3795,15.3935); sHospital[playerid][2] = 0; } else if(sHospital[playerid][3]) { SetPlayerPos(playerid,2029.2570,-1419.2135,16.9922); sHospital[playerid][3] = 0; } else if(sHospital[playerid][4]) { SetPlayerPos(playerid,1244.6365,332.0834,19.5547); sHospital[playerid][4] = 0; } else if(sHospital[playerid][5]) { SetPlayerPos(playerid,-319.9589,1050.6843,20.3403); sHospital[playerid][5] = 0; } else if(sHospital[playerid][6]) { SetPlayerPos(playerid,607.0730,1819.1471,10.8280); sHospital[playerid][6] = 0; } else if(sHospital[playerid][7]) { SetPlayerPos(playerid,-1514.7872,2523.3406,55.8154); sHospital[playerid][7] = 0; }
Код:
272: sHospital[playerid][8] = 1;
Код:
(272) : error 032: array index out of bounds (variable "sHospital")