hey ich habe irgendwie ein Merkwürdigen Fehler mein Pickup wird nicht gelöscht
Wenn ich eine Zweite erstelle und gehe durch die weiter verschwindet die erste aber wieso ?
[24/11/2016 16:44:35] 0
[24/11/2016 16:44:35] Test 0
[24/11/2016 16:44:35] Test 1
[24/11/2016 16:44:35] 1
Code
for(new i = 0; i < sizeof(pfandf); i++)
{
printf("Test %d",i);
if(pickupid == FlaschenPickup[i])
{
printf("%d",i);
DestroyDynamicPickup(FlaschenPickup[i]);
GivePlayerMoney(playerid,25);
return 1;
}
}
Alles anzeigen
Code
ocmd:createpfandflasche(playerid)
{
if(pInfo[playerid][pLoggin] == false) return 1;
if(!GetPlayerAdmin(playerid,5)) return SendAdminError(playerid);
new Float:x,Float:y,Float:z;
for(new i = 0; i < sizeof(pfandf); i++)
{
if(FlaschenPickup[i] == MAX_PFANDFLASCHEN) return SendClientMessage(playerid,ROT,"Maximum an Pfandflaschen erreicht.");
if(FlaschenPickup[i] != 0) continue;
GetPlayerPos(playerid,x,y,z);
pfandf[i][pf_x] = x;
pfandf[i][pf_y] = y;
pfandf[i][pf_z] = z;
new flaschenmodel = random(12);
switch(flaschenmodel)
{
case 0: FlaschenPickup[i] = CreateDynamicPickup(1486, 1, pfandf[i][pf_x],pfandf[i][pf_y],pfandf[i][pf_z], 0);
case 1: FlaschenPickup[i] = CreateDynamicPickup(1509, 1, pfandf[i][pf_x],pfandf[i][pf_y],pfandf[i][pf_z], 0);
case 2: FlaschenPickup[i] = CreateDynamicPickup(1512, 1, pfandf[i][pf_x],pfandf[i][pf_y],pfandf[i][pf_z], 0);
case 3: FlaschenPickup[i] = CreateDynamicPickup(1517, 1, pfandf[i][pf_x],pfandf[i][pf_y],pfandf[i][pf_z], 0);
case 4: FlaschenPickup[i] = CreateDynamicPickup(1520, 1, pfandf[i][pf_x],pfandf[i][pf_y],pfandf[i][pf_z], 0);
case 5: FlaschenPickup[i] = CreateDynamicPickup(1543, 1, pfandf[i][pf_x],pfandf[i][pf_y],pfandf[i][pf_z], 0);
case 6: FlaschenPickup[i] = CreateDynamicPickup(1544, 1, pfandf[i][pf_x],pfandf[i][pf_y],pfandf[i][pf_z], 0);
case 7: FlaschenPickup[i] = CreateDynamicPickup(1551, 1, pfandf[i][pf_x],pfandf[i][pf_y],pfandf[i][pf_z], 0);
case 8: FlaschenPickup[i] = CreateDynamicPickup(1664, 1, pfandf[i][pf_x],pfandf[i][pf_y],pfandf[i][pf_z], 0);
case 9: FlaschenPickup[i] = CreateDynamicPickup(1668, 1, pfandf[i][pf_x],pfandf[i][pf_y],pfandf[i][pf_z], 0);
case 10: FlaschenPickup[i] = CreateDynamicPickup(1669, 1, pfandf[i][pf_x],pfandf[i][pf_y],pfandf[i][pf_z], 0);
case 11: FlaschenPickup[i] = CreateDynamicPickup(1950, 1, pfandf[i][pf_x],pfandf[i][pf_y],pfandf[i][pf_z], 0);
}
printf("%d",i);
SendClientMessage(playerid,ROT,"Du hast eine Pfandflsche erstellt.");
break;
}
return 1;
}
Alles anzeigen