17.06.2011, 07:36
PHP код:
if(strcmp(cmd, "/gettagiubbotto", true) == 0 || strcmp(cmd, "/gagb", true) == 0)
{
new Float: plyArmours;
GetPlayerArmour(playerid, plyArmours);
if(plyArmours != 0)
{
new f = maxobj+1;
for(new a = 0; a < sizeof(ObjCoords); a++)
{
if(ObjCoords[a][0] == 0.0)
f = a;
}
if(f == maxobj+1) return SendClientMessage(playerid, 0x33AA3300, " Non и possibile gettare un Giubbotto in questo momento, riprova piщ tardi !");
else
{
Armatura[f] = plyArmours; <---- This is the error line
SendClientMessage(playerid, 0x33AA3300, " Hai gettato un Giubbotto AntiProiettile a terra !");
SetPlayerArmour(playerid, 0);
GetPlayerPos(playerid, ObjCoords[f][0], ObjCoords[f][1], ObjCoords[f][2]);
object[f] = CreateDynamicObject(373 ,ObjCoords[f][0],ObjCoords[f][1],ObjCoords[f][2]-1,93.7,120.0,120.0);
format(string, sizeof(string), " Armatura %f% !", Armatura[f]);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
return 1;
}
if(strcmp(cmd, "/raccogligiubbotto", true) == 0 || strcmp(cmd, "/ragb", true) == 0)
{
new f = maxobj+1;
for(new a = 0; a < sizeof(ObjCoords);a++)
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, ObjCoords[a][0], ObjCoords[a][1], ObjCoords[a][2]))
f = a;
}
if(f == maxobj+1 || Dropped[f] == 1) return SendClientMessage(playerid, 0x33AA3300, " Non ci sono Giubbotti quм a terra !");
else
{
ObjCoords[f][0] = 0.0;
ObjCoords[f][1] = 0.0;
ObjCoords[f][2] = 0.0;
DestroyDynamicObject(object[f]);
SetPlayerArmour(playerid, Armatura[f]);
SendClientMessage(playerid, 0x33AA3300, " Hai raccolto un Giubotto AntiProiettile da terra !");
format(string, sizeof(string), " Armatura %f% !", Armatura[f]);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
return 1;
}