16.06.2013, 19:29
Thank you - that works. But the problem is not solved completely. To describe the system it creates car parts, that can get collected by players. So I use theese loops to create the pickups:
The pickups are created - up to this time it works fine.
But the problem is, that a player is just able to collect a car part, that was created at last. In my example it would be the "Nitro" Pickups. So there e.g. a tire pickup, but the player is not able to collect it. The player can just pickup all nitro pickups. When I change the loops the player maybe is able to collect tires.
Here is my OnPlayerPickUpDynamicPickup:
I really don't know where's the problem....
Код:
for(new i = 0; i < MAX_PANZERUNG_PICKUPS; i++) { SetAutoteilRandomPosInArea(i,362.0141, -1891.816, 2826.046, 303.6248,2); } for(new i = 0; i < MAX_REIFEN_PICKUPS; i++) { SetAutoteilRandomPosInArea(i,362.0141, -1891.816, 2826.046, 303.6248,0); } for(new i = 0; i < MAX_NITRO_PICKUPS; i++) { SetAutoteilRandomPosInArea(i,362.0141, -1891.816, 2826.046, 303.6248,1); }
But the problem is, that a player is just able to collect a car part, that was created at last. In my example it would be the "Nitro" Pickups. So there e.g. a tire pickup, but the player is not able to collect it. The player can just pickup all nitro pickups. When I change the loops the player maybe is able to collect tires.
Here is my OnPlayerPickUpDynamicPickup:
Код:
new Gesamt_Pickups = CountDynamicPickups(); for(new i = 0; i < Gesamt_Pickups; i++) { if(pickupid == AutoteilInfo[i][PickupID]) { new type = AutoteilInfo[i][Type]; printf("Debug: %d", type); DestroyDynamicPickup(AutoteilInfo[i][PickupID]); DestroyDynamic3DTextLabel(AutoteilInfo[i][LabelID]); SetAutoteilRandomPosInArea(i,362.0141, -1891.816, 2826.046, 303.6248,type); SpielerInfo[playerid][pAutoteile][type]++; new str[124]; switch(type) { case 0: format(str,sizeof(str),"Du hast gerade deinen %d. Autoreifen gefunden!",SpielerInfo[playerid][pAutoteile][type]); case 1: format(str,sizeof(str),"Du hast gerade deine %d. Nitroflasche gefunden!",SpielerInfo[playerid][pAutoteile][type]); case 2: format(str,sizeof(str),"Du hast gerade dein %d. Fahrzeugpanzerungselement gefunden!",SpielerInfo[playerid][pAutoteile][type]); } SendClientMessage(playerid,COLOR_RED,str); }