Dynamic Pickup Problem
#1

Functions do not work when I enter into the pickup. Can you help me ?

Code:
fonksiyon-> PickupYukle()
{
    new rows;
	cache_get_row_count(rows);
	if(rows)
  	{
   		new id, yukle, sz[68 + 6 + 20];
   		for(new i = 0; i < rows; i++)
   		{
   		    cache_get_value_name_int(i, "id", id);
   		    cache_get_value_name_int(i, "pid", PickupIslem[id][pickup_id]);
   		    cache_get_value_float(i, "xx", PickupIslem[id][pickup_pos][0]);
   		    cache_get_value_float(i, "yy", PickupIslem[id][pickup_pos][1]);
   		    cache_get_value_float(i, "zz", PickupIslem[id][pickup_pos][2]);
   		    cache_get_value_name_int(i, "interior", PickupIslem[id][pickup_interior]);
   		    cache_get_value_name_int(i, "vw", PickupIslem[id][pickup_virtual]);
   		    cache_get_value_name(i, "yazi", PickupIslem[id][pickupYazi], 68);
   		    cache_get_value_float(i, "gx", PickupIslem[id][pickup_gir][0]);
   		    cache_get_value_float(i, "gy", PickupIslem[id][pickup_gir][1]);
   		    cache_get_value_float(i, "gz", PickupIslem[id][pickup_gir][2]);
   		    cache_get_value_float(i, "ga", PickupIslem[id][pickup_gir][3]);
   		    cache_get_value_name_int(i, "gi", PickupIslem[id][pickup_gir_interior]);
   		    cache_get_value_name_int(i, "gv", PickupIslem[id][pickup_gir_virtual]);
   		    PickupIslem[id][pickup_load] = CreateDynamicPickup(PickupIslem[id][pickup_id], 1, PickupIslem[id][pickup_pos][0], PickupIslem[id][pickup_pos][1], PickupIslem[id][pickup_pos][2], PickupIslem[id][pickup_virtual], PickupIslem[id][pickup_interior], -1, 10.0);
			format(sz, sizeof(sz), "%s {2ecc71}(ID: %d)", PickupIslem[id][pickupYazi], id);
			PickupIslem[id][pickup_text] = CreateDynamic3DTextLabel(sz, 0xFFFFFFFF, PickupIslem[id][pickup_pos][0], PickupIslem[id][pickup_pos][1], PickupIslem[id][pickup_pos][2], 10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, PickupIslem[id][pickup_virtual], PickupIslem[id][pickup_interior]);
			Iter_Add(Pickuplar, id);
			yukle++;
   		}
    	log->("Pickup:: %d", yukle);
  	}else log->("Pickup:: 0");
	return 1;
}

public OnPlayerPickUpDynamicPickup(playerid, pickupid)
{
    Bilgi(playerid, "PID:: %d", pickupid);
	foreach(new i: Pickuplar)
	{
		if(pickupid == PickupIslem[i][pickup_load])
		{
		    if(PickupIslem[i][pickup_gir][0] == 0.0) continue;
		    if(IsPlayerInAnyVehicle(playerid)) continue;
		    SetPlayerInterior(playerid, PickupIslem[i][pickup_gir_interior]);
		    SetPlayerVirtualWorld(playerid, PickupIslem[i][pickup_gir_virtual]);
		    SetPlayerPos(playerid, PickupIslem[i][pickup_gir][0], PickupIslem[i][pickup_gir][1], PickupIslem[i][pickup_gir][2]);
		    SetPlayerFacingAngle(playerid, PickupIslem[i][pickup_gir][3]);
		    SetCameraBehindPlayer(playerid);
		    break;
		}
	}
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)